- 1
It is not working. Why???
#include<iostream> using namespace std; int main() { int n; cout<<"enter a no."; cin>> n; int i=0; int sum=0; for(;n*2>i;i+2) { sum=sum+i; } cout<<sum; return (0); }
5 Réponses
+ 3
i+2 should be i+=2
+ 2
In for loop it should be i+=2
0
Enter i + = 2 ....bro
- 1
Thanks