0
WAP using function to print first 10 numbers and their sum
please help me
4 Respuestas
+ 2
#include <iostream>
using namespace std;
int main ()
{
int sum=0;
for (int i =0;i <=10;i++)
sum +=i;
cout <<sum;
return 0;
}
sorry, thought you only needed the algorithm
0
Ismail where is int n ..
0
thks destro
- 2
#include<iostream>
using namespace std;
int main()
{
int i,n;
{
for(i=0;i<10;i++)
{
cout<<i<<endl;
sum+=i;
}
cout<<sum;
return 0:
}