I need to find S and please explain how did you find S in N is 4
#include <iostream>
int main ()
{
int n,i,s;
cout<<"Put the number of n"<<endl;
cin>>n;
s=0
for (i=1;i<=n;i++)
s=s+i
cout<<"S is<<s<<endl;
return 0
}
CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | VB Forums | Developer.com |
Results 1 to 9 of 9
Thread: help me with c++Threaded View
|
Click Here to Expand Forum to Full Width |