# sum of first 10 natural numbers using c programming

In computer programming, C language is very effetive. In the sense, using 'c', we can see the hard disk address with the help of pointers. I will publish some simple pointer progarammes later.

#include<stdio.h>

#include<conio.h>

void main()

{

clrscr();

int i,sum=0;

for(i=1;i<=10;i=i+1) // starting for loop, this loop will execute until the value of i reaches 10.

{

sum=sum+i; // add the values of sum with i and save it to sum itself.

}

printf("Sum of first 10 natural numbers is %d", sum);

getch();

}

--------------------------------------------------------

NB: stdio.h & conio.h ----> header files

clrscr() ---> for clearing the screen

printf() ----> for printing the result.

getch() ----> screen will wait until a key is pressed.

------> for running the program press Ctrl + F9 key together, it will compile & run the program

----------------------------------------------------------

thanks a lot.

hope u get the result. :-)

## Comments 22 comments

www.shivendragupta.blogspot.com

your code is incorrect

dear sir,plz send me the programe for replacing the string by using files............

i like it

easy to understand..thanks

It's nice

dear sir,

please send program

1.to add 10 number

2.to add 10 number and find averaqge using arrays

3.to sort the n number using array

4.add 10 number using ponter with arrays

5.sort the n number using ponters

my email id is blinkingstars405@gmail.com

big fake

big fake

thank u

thank u for urgood presentation

nice

Thanks a lot for preparing Easyly

i want its algorithm.......

how to find this problem

take two numbers, a and b as input and find axb(their product)without using the operator

Thnx a lot solving my problm.Bcz i was in big confused 0 is prime number or natural number. ..

Here i saw,nd my problem is solved....

Thanks.......

Thanks a lot to solving my problem..

Thanku very much

THANK U

why did we take sum=0;

Thank You

thank

22