the sum means to add so its d+7
#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(); }
nihil
void main () { int no1, sum, n; clrscr() sum = 0; n = 1; printf("\n enter the number to which sum is to be generated"); scanf("%d",&no1); while(n<=no1) { sum=sum+n; n=n+1 } printf("\n the sum of %d = %d, no1, sum"); getch (); }
# include <stdio.h> main() { int num,count,sum; count=0; sum=0; printf("enter an integer :"); scanf("%d",&num); printf("ur num is : %d \n",num); while (num!=0) { count++; sum+=num%10; num/=10; } printf("sum of the digits is : %d",sum); }
the sum means to add so its d+7
a + d
18 + d
d + f.
D + D = M
#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(); }
nihil
#include<stdio.h> #include,conio.h> void main() int a,b,d; pintf("enter the number"); scanf("%d%d",&a,&b); d=add(a,b); pintf("sum=%d",d); } add(a,b) { int sum; sum=a+b; return (sum); getch(0; }
void main () { int no1, sum, n; clrscr() sum = 0; n = 1; printf("\n enter the number to which sum is to be generated"); scanf("%d",&no1); while(n<=no1) { sum=sum+n; n=n+1 } printf("\n the sum of %d = %d, no1, sum"); getch (); }
# include <stdio.h> main() { int num,count,sum; count=0; sum=0; printf("enter an integer :"); scanf("%d",&num); printf("ur num is : %d \n",num); while (num!=0) { count++; sum+=num%10; num/=10; } printf("sum of the digits is : %d",sum); }
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); }
#include<stdio.h> #include<conio.h> void factor(int num) { int i,sum=0; for(i=1;i<num;i++) { if(num%i==0) { sum=sum+i; } } printf("Sum of the factor of %d is %d",num,sum); } void main() { int num; printf("Enter the number="); scanf("%d",&num); factor(num); getch(); }