5 x (6 + n)
Let's denote the five consecutive numbers as n, n+1, n+2, n+3, and n+4. The sum of these numbers is given by n + (n+1) + (n+2) + (n+3) + (n+4) = 5n + 10 = 40. Solving for n, we get n = 6. Therefore, the five consecutive numbers are 6, 7, 8, 9, and 10.
If you want to sum up numbers 1 to N, you can do it this way. Sum = (N+1)*(N/2).The reason this works: say you want to sum up 1 through 10. You have 10+1, 9+2, ..., 6+5. Each of these equals 11 [N+1]. You added 11 five times (N/2). Sum of 1 to 102 = (102+1)*(102/2) = 103*51 = 5253. You can check it by summing up the numbers with a spreadsheet.
sum = 0 for(n = 0; n <= 10; n += 2) sum += n;
n + (8 + 6)
5+9(n)
5 x (6 + n)
Let 'n' represent any number, and 'S' represent sum. S = 5 + 2n
2(7+5)=n 2(12)=n 24=n but its an opposite n, so the answer is -24
5*n + (n - 8) = 5n + n - 8 = 6n - 8
The sum of n and 5 is n+ 5
The question is ambiguous and the possible answers are n + 5*6 = n + 30 or (n + 5)*6
THIS IS ONLY FOR UPTO A FIVE DIGIT NO. BY ROHAN ARORA#include#includevoid main(){int a,n,s,sum=0;clrscr();printf("Enter the number between 1 to 5 digits\n");scanf("%d",&a);while(a!=0){n=a%10;sum=sum+n;a=a/10;}printf("The sum of digits of the given numberis %d",sum);getch();}
540 degrees according to the formula: 180(n-2)
#include<stdio.h> #include<conio.h> main() { int n,sum=0; printf("enter n value"); scanf("%d",n); while(n!=0) { n=n/10; sum=sum+n; n=n%10; } printf("sum is=%d",sum }
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 (); }
int sum (int n){if (n