Code Box
----------------------------------
/* program to print square and cube of numbers between range*/
#include<stdio.h>
#include<conio.h>
void main()
{
int i,sq,cu,br,ij;
printf("\nEnter Start number:");
scanf("%d",&br);
printf("\nEnter End number:");
scanf("%d",&ij);
printf("\n--------------------");
for(i=br;i<=ij;i++)
{
sq=i*i;
cu=i*sq;
printf("\n\t Number:%d",i);
printf("\n\t Square:%d",sq);
printf("\n\t Cube :%d",cu);
printf("\n--------------------");
}
getch();
}
No comments:
Post a Comment