answersLogoWhite

0


Best Answer

if (n%2==0) sum=n/2*(n+1);

else sum=(n+1)/2*n;

User Avatar

Wiki User

โˆ™ 2009-08-16 10:57:09
This answer is:
User Avatar
Study guides
๐Ÿ““
See all Study Guides
โœ๏ธ
Create a Study Guide
4.18
โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…
11 Reviews

Add your answer:

Earn +20 pts
Q: Find the sum of 1 plus 2 plus 3 plus . plus n nos using c program?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Find the greater no between two nos using pointer in c plus plus programming?

if (*&a > *&b) *&max = *&a; else *&max = *&b;


How do you print nos from 10-0 then only even nos are printed in a program flowchart?

10


Coding in c plus plus to swap two nos using pointer?

void swap (int &pa, int &pb) { *pa ^= *pb; *pb ^= *pa; *pa ^= *pb; }


Using while loop write a program which calculates the product of digits from 1 to 5 and also show these nos vertically?

Using while loop, write a program which calculates the product of digits from 1 to 5 and also show these no's vertically.


How do you use super Nos Pump to lose weight?

How do you lose weight using super nos pump


Differtiate window NOS over unix NOS?

If both Windows and Unix are using TCP/IP as their primary NOS there isn't much difference to speak of.


How do you write a program to print prime numbers from 1 to 1000 using C plus plus?

#include#include#includevoid main(){int i,j;clrscr();for(i=3;i


C program for summation of n nos using recursion?

int sum (int n) { if (n<=1) return n; else return n + sum (n-1); }


C program to find the sum of first 100 odd nos and even nos?

main() { int i,sumo=0,sume=0,oddno,evenno; for(i=1,oddno=1,evenno=2;i<=100;++i,oddno=oddno+2,evenno=evenno+2) { sumo=sumo + oddno; sume=sume + evenno; } printf("Sum of odd nos = %d And Sum of even nos = %d,sumo,sume); }


How do you find the sum of nos in a series?

It depends on the series.


What is the difference between joining a workgroup and joining a domain?

The difference is using a NOS ( Network Operating System), A Domain uses a NOS whereas a Workgroup does not.


What does a ver que nos encontramos mean?

To see what we find.

People also asked