answersLogoWhite

0


Best Answer

Your question is not clear but i can write a program to find the sum of n natural numbers.

#include<iostream.h>

#include<conio.h>

int main()

{

long int res=0;

int last;

cout<<"enter the last number.";

cin>>last;

for(int i=0;i<=last;i++)

res=res+i;

cout<<"Result is "<<res<<endl;

return 0;

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a c plus plus programs to find the sum of first n natural number and to display the number of terms edit?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write c programs to display 10 line biodata?

A C++ program can be used to write C programs that will display 10 lines of biodata. Many types of C programming can be written with a C++ program.


Is it possible to write the largest natural number?

No.


Write a program to display the name of days when a user enters a number?

write a program to display your name age class schoolname e-mail 2hobby based on choice


Write a program which takes any number of days from the user the program should display the number of years number of months formed by these days as well as the remaining days?

Write a program which takes any number of days from the user. the program should display the number of years, number of months formed by these days as well as the remaining days.


Why do we sometimes add a zero to a number in a calculator display?

to report an answer with the correct number of significant figures, you may need to write significant zeros after the calculator number.


Write a program in c plus plus that can display addition result of 9 numbers by using for loop?

Example Code#include#includeunsigned input_num (){unsigned num = 0;while (1){std::cout > num)break;std::cout


Write a program in shell script to display odd number from 0 to 100?

seq 1 2 99


Write a shell programs for to check whether the given number is an Avogadro number or not?

Avogadro's number is a constant. Therefore only one number is equal to Avogadro's number.


Can c write programs?

A programmer can write programs in C, but C can't write anything by itself.


Why to write programs when you have calculators?

You mean the calculators should write the programs? Well, they couldn't.


Write a java program to display the number is prime or not?

Simply use a for loop (i) that runs from 2 to N-1. Checking if N % i 0 then its a prime number.


Write a CGI application which accepts three number from the used and display biggest number using post and get method?

Find your own answers....sucks mahn