Example
#include<stdio.h>
#include<conio.h>
void main()
{
int i=1,n;
clrscr();
printf("Enter the number:");
scanf("%d",&n);
printf("\nN\tN^2\tN^3");
while(i<=n)
{
printf("\n%d \t%d \t%d",i,(i*i),(i*i*i));
i++;
}
getch();
}
/*=================================================================
OUTPUT
Enter the number:3
N N^2 N^3
1 1 1
2 4 8
#include<stdio.h>
#include<conio.h>
void main()
{
int i=1,n;
clrscr();
printf("Enter the number:");
scanf("%d",&n);
printf("\nN\tN^2\tN^3");
while(i<=n)
{
printf("\n%d \t%d \t%d",i,(i*i),(i*i*i));
i++;
}
getch();
}
/*=================================================================
OUTPUT
Enter the number:3
N N^2 N^3
1 1 1
2 4 8
No comments:
Post a Comment