ADD any first "N" ODD numbers
========================================================================
#include<iostream>
using namespace std;
main()
{
int sum=0,n,nums,m;
cout<<"Enter total Numbers to add\n";
cin>>n;
m=(n*2);
for(int i=1;i<=m;i++)
{
if(i%2!=0)
{
sum=sum+i;
}
}
cout<<"Sum of two numbers\n";
cout<<sum;
}
========================================================================
Code By: Kabeer Hussain & Usman Ibrahim
0 comments:
Post a Comment