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);
}
simple program
algorithm is a way to solve your problem
Three ways.. Multiply n by itself. Calculate Sum[2i+1,{i,0,n-1}] Calculate Sum[n,{i,1,n}]
public static final int getSum(final int n) { int sum = 0; for(int i = 1; i <= n; ++i) { sum += i; } return sum; }
In QBASIC, you can write a simple program to input the number 64751315 and sum its digits as follows: DIM sum AS INTEGER sum = 0 INPUT "Enter a number: "; number FOR i = 1 TO LEN(number) sum = sum + VAL(MID$(number, i, 1)) NEXT PRINT "The sum of the digits is "; sum This program prompts the user to input a number, iterates through each digit, converts it to an integer, and adds it to the total sum, which is then printed out.
To calculate the sum of all even numbers starting from 20 until the sum exceeds 1000, you can initialize a variable for the sum and a counter starting at 20. In a loop, add the counter to the sum and increment the counter by 2 (to keep it even) until the sum exceeds 1000. The final sum will be the total of all even numbers added. Here's a simple pseudocode example: sum = 0 number = 20 while sum <= 1000: sum += number number += 2
The quotient of the sum of a number and three, and four is seven
The sum of four and the product of three and a number xxxx.
n+3 the sum of a number and three means a number plus three.
int sum = 0; int n = 0; while( sum <= 999 ) { sum += (++n); }
Their sum is three times the middle number.
There are not three odd primes with the sum of 14. The sum of three odd primes will be an odd number.