C++ Programming Practice

// This program is written to find the sum of a series  1+2+3+.........+n. This program will calculate the sum value from 1 to entered value n. This program is tested. You can run it.//


#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

long double sum=0,n,i;

cout<<"enter n:";

cin>>n;

for(i=1;i<=n;i++)

{

sum+=i;

}

cout<<sum;

getch();


NB: You can put your valuable comments to improve the blog content. 


The writer is Oracle Certified Professional, trainer, innovator,  researcher and can be contacted at the mail rashid.eee.cse@gmail.com


Comments

Post a Comment

Popular posts from this blog

How to be an Innovative Speaker?

Developing Personal Skills

Differences between the terms Science, Technology, and Engineering