#include "stdio.h"
#include"conio.h"
#include"conio.h"
void main()
{
int i,sum=0,n;
clrscr();
printf("Enter the number:\t");
scanf("%d",&n);
clrscr();
for(i=1;i<=n;i++)
{
printf("%d\n",i);
sum=sum+i;
}
printf("The sum of the integers is %d",sum);
getch();
}
0 comments:
Post a Comment