Program code:
#include<stdio.h>
#include<conio.h>
int main()
{
int num,op;
//clrscr();
do
{
printf("enter a number:\n");
scanf("%d",&num);
printf("square root of %d is %d\n",num,num*num);
printf("want to try another number? \n(enter 1 for yes /0 for no)\n");
scanf("%d",&op);
}
while(op==1);
//getch();
return 0;
}
#include<stdio.h>
#include<conio.h>
int main()
{
int num,op;
//clrscr();
do
{
printf("enter a number:\n");
scanf("%d",&num);
printf("square root of %d is %d\n",num,num*num);
printf("want to try another number? \n(enter 1 for yes /0 for no)\n");
scanf("%d",&op);
}
while(op==1);
//getch();
return 0;
}
output:
enter a number:
2
square root of 2 is 4
want to try another number?
(enter 1 for yes/0 for no)
n