I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
Index » Programming » C/C++ »

trowa0830\′s Photo
10 Jul 08, 5:54PM
it looks like this
#include<stdio.h>
#include<conio.h>
main()
{
int sum,n1,n2,n3,n4;
clrscr();
printf("Enter numbers: ");
scanf("%d%d%d%d",&n1,&n2,&n3,&n4);
sum=n1+n2+n3+n4;
while(1)
{
  scanf("%d",&n1);
  sum+=n1;
  if(n1==0) break;
}
 
printf("\n The sum is: %d", sum);
getch();
}
Currently you need to be logged in to leave a message.