Sum means to add.. so the equation would look like 3(c+d) or (c+d)*3. You could also add them separately. 3c+3d Hope that helps!
Chat with our AI personalities
C. 6
/*use "c-free" compiler*/ #include <stdio.h> main() { int a,b,c; printf("enter the value of a & b"); scanf("%d%d",&a,&b); c=a+b; printf("sum of the two numbers is a+b- %d",c); getch(); }
//Adding two numbers using pointers #include<stdio.h> void main() { int *a,*b,c,n1,n2; scanf("%d %d",&n1,&n2); a=&n1; b=&n2; c=*a+*b; printf("Added value is:%d",c); }
main(){int n,a[i],s;s=0;printf("enter no of elements in array");scanf("%d",&n);printf("Enter elements in array");for(i=;i
#include<stdio.h> main() { int a,b,c,d; // The four integers to be asked printf("Give the first integer: "); //asks for the first integer scanf("%d",&a); // puts the user input in the address of the integer "a" printf("Give the second integer: "); //same explanations scanf("%d",&b); printf("Give the third integer: "); scanf("%d",&c); printf("Give the fourth integer: "); scanf("%d",&d); printf("1. The sum of the four integers is: %d",a+b+c+d); //prints the sum of the four integers given by the user, notice the "a+b+c+d" at the end) printf("2. The sum of the first two numbers minus the sum of the last: %d",a+b-c-d); //prints the second condition by putting the correct operations return 0; //ends the program } I never tested this program though, but i think it would work.