P. 1
8 Natural For

8 Natural For

|Views: 1|Likes:
Published by Rajesh Verma
nn8
nn8

More info:

Categories:Types, School Work
Published by: Rajesh Verma on Jul 08, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

07/08/2013

pdf

text

original

//WAP to find out sum of n natural numbers using for loop. #include<iostream.h> #include<conio.

h> main() { int i,n,sum; cout<<"\n Enter the value of n :"<<endl; cin>>n; sum=0; for(i=1;i<=n;i++) sum=sum+i; cout<<"sum="<<sum; getch(); }

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->