Full width home advertisement

HTML

Tech News

Ad

 Write a c program to find the sum of first 100 natural numbers



#include<stdio.h>
#include<conio.h>

void main()
{
	int i=0,sum=0;
	clrscr();
	do{
	sum=sum+i;
	i=i++;
	}while(i<=100);
	printf("Sum of first 100 nactural numbers : %d",sum);
	getch();
}

Thank you for your time seeya agaibn

No comments:

Post a Comment

Bottom Ad [Post Page]