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.
it's simple: { int a,b,c,d; printf("enter the numbers"); scanf("%d %d %d" &a &b &c); d=a+b+c; printf("the sum is=%d" d); }
C. 6
//sum and product of 3 nos #include #include void main() { int a,b,c; printf("enter the 3 nos"); scanf("%d%d%d",&a,&b,&c); printf("sum of 3 nos",a+b+c); printf("product of 3 nos",a*b*c); getch(); }
#include<stdio.h> #include<stddef.h> int main() { inta,b,c; printf("enter the three numbers"); if(scan f("%d %d %d",&a,&b,&c)==3) { a+=b+c; printf("the sum is %d",a); } else { printf("invalid input!\n"bye!\n\n"); exit(exit_failure); } return exit_success; }
Easy, the fourth vector (D) be opposite the sum of the other three non-coplanar vectors (A , B, C). 0=A + B + C + D where D = -(A + B + C).
/*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(); }
/*mycfiles.wordpress.com To Calculate Sum & Average of 4 no.*/ #include<stdio.h> #include<conio.h> void main() { float a,b,c,d,sum,avg; clrscr(); printf("Enter the 4 nos.\n\n"); scanf("%f%f%f%f",&a,&b,&c,&d); sum=a+b+c+d; avg=(a+b+c+d)/4; printf("\nSum is= %f\nAverage is= %f",sum,avg); getch(); }
"the same as the others added together" For example: a=b+c+d a is equal to the sum of b plus c plus d. 9=2+3+4
#include<stdio.h> #include<conio.h> main() { int a,b,sum=0; clrscr(); printf("Enter two variable:--"); scanf("%d%d",&a,&b); sum=a+b; printf("Sum of %d+%d=%d",a,b,sum); 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); }
A cubic polynomial: y = ax3 + bx2 + cx + d where a, b, c, and d are constants.
C. Two times