answersLogoWhite

0

#include<stdio.h>

void main()

{

long long int sum=0,n,i,b;

printf("How many numbers do you want to add?\n");

scanf("%lld",&n);

printf("Enter those %lld numbers\n",n);

for(i=0;i<n;i++)

{

scanf("%lld",&b);

sum=sum+b;

}

printf("Sum of all the numbers you entered is %lld",sum);

getch();

}

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

C program find magic number less than 1000?

#define int main (void){/*Algorithm*/1. First Initialize the number that is Random no2. Using while loop if the person got it, then the loop stop if not the loop continues.}return(0);


C program to find square of number using do while loop?

class Abc { public static void main(String[] args) { System.out.println("Hello World!"); } }


Write a program using while loop?

//program to find the factorial value f any number using while loop #include&lt;stdio.h&gt; void main() { int i,n,fact=1; printf("Enter the number\n"); scanf("%d",&amp;n); i=n; while (i&gt;=1) { fact=fact*i; i--; } printf("The factorial value=%d",fact); } the above is a program for calculating tha factorial value of any number which is entered by the user


How do you loop a program in python 3?

A program can be looped in Python by wrapping the entire program in a for or while loop. If you wish to loop the program a finite amount of times, it can be done like so (x = the amount of times you want it to loop, this can be a number or variable storing a number): for i in range(0,x): [code] If you wish to loop the program infinitely, you can use a simple while loop: while True: [code]


How do you sum a number's all digit using for loop?

Using for loop we can find sum of digits of a number. Inside the loop just perform Logic Expression 1) rem=num%10. {To find the unit place no. using remainder functon} 2) sum = sum+rem {to find the addition ie output} 3) num=num/10 {to eliminate the added digit} Just repeat these steps in the loop.


What is the time complexity of using a while loop inside a for loop?

The time complexity of using a while loop inside a for loop is O(nm), where n is the number of iterations of the for loop and m is the number of iterations of the while loop.


What is the runtime complexity of a while loop in a program?

The runtime complexity of a while loop in a program is typically O(n), where n represents the number of iterations the loop performs.


To find biggest of four numbers using if else loop?

largest number a,b,c,d


Shell program for calculating compound interest using for loop?

yes


How do you write a c program to design calculator using loop?

Wr


C program algorithm for simple interest using while loop?

Not used


Using while loop Write a program find the factors of a number?

by this program you can find the factorial: #include&lt;iostream&gt; using namespace std; main() { int n,x,f=1; cin&gt;&gt; n; x=0; while(x&lt;n) { x++; f= f*x; } cout&lt;&lt;"factorial is"&lt;&lt;f&lt;&lt;"\n"; system("pause"); return 0; }