Hi Friends ! You are on HR Developers website. Here you can find the codes of different languages like c ,c++ , java, pyton and many other languages.
#include<iostream>
using namespace std;
int main()
{
int i,num,sum=0;
cout<<"please enter your number:";
cin>>num;
for(i=1;i<=num;i++)
cout<<i*2<<endl;
sum=sum+i*2;
}
cout<<"the sum of the all even number is:"<<sum<<endl;
No comments:
Post a Comment