Computer Science, asked by ankit41947, 1 year ago

write a program in C- language that prints the sum of all the numbers from one to twenty . write also , the output of this program .​

Answers

Answered by vikisnake
1

#include<iostream>

using namespace std;

int main()

{

int i;

for(i=20; i<=20; i++)

{

sum+=i;

}

cout<<sum;

return 0;

}

OUTPUT:

210


ankit41947: thanks
Anonymous: This is C++. Then what's the difference between C language and C++
ankit41947: yes sir mujhe or questions puchne hai
Answered by purva2004
0

#include<iostream>

using namespace std;

int main()

{

int i;

for(i=20; i<=20; i++)

{

sum+=i;

}

cout<<sum;

return 0;

}

OUTPUT:

210

Similar questions