#include<stdio.h>
#include<conio.h>
void main()
{
int n;
void sum();
clrscr();
printf("Enter the value of n:");
scanf("%d",&n);
printf("\n\nFirst %d natural numbers are:\n\n",n);
while(i<=n)
void sum();
getch();
}
void sum()
{
int i=1,sum=0;
printf("%5d",i)
sum+=i;
i++;
printf("\nSum=%d",sum);
}
#include<conio.h>
void main()
{
int n;
void sum();
clrscr();
printf("Enter the value of n:");
scanf("%d",&n);
printf("\n\nFirst %d natural numbers are:\n\n",n);
while(i<=n)
void sum();
getch();
}
void sum()
{
int i=1,sum=0;
printf("%5d",i)
sum+=i;
i++;
printf("\nSum=%d",sum);
}
No comments:
Post a Comment