
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

#include<iostream.h> #include<conio.h> void main (void) { int x=1,s=0; clrscr(); while (x>=0) { cin>>x; if (x>=0) s=s+x; } cout<<"\nThe sum is: "<<s; getch(); }