Write a program which take a integer from user and tell
whether the given variable is squar of some number or not.
eg: is this number is 1,4,9,16... or not

Answer Posted / vrushali

#include <stdio.h>
#include <math.h>
#include <stdlib.h>

int main ()
{
int num = 0;
int sqr = 0;
while (1)
{
printf ("\n Enter the no for finding sqaure root ");
scanf ("%d",&num);

if (num==0)
break;
else
{
sqr = sqrt(num);
if (num/sqr == sqr)
printf ("\n Number's sqaure root %d",sqr);
else
break;
}
}
return 0;
}
~

Is This Answer Correct ?    1 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

2993


When would you use a pointer to a function?

591


Explain the use of bit fieild.

719


How do we make a global variable accessible across files? Explain the extern keyword?

1428


What is the difference between far and near in c?

607






write a c program to calculate sum of digits till it reduces to a single digit using recursion

2727


Is c a great language, or what?

613


please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code

1712


What is sizeof return in c?

621


a program that can input number of records and can view it again the record

1490


how can f be used for both float and double arguments in printf? Are not they different types?

615


The __________ attribute is used to announce variables based on definitions of columns in a table?

679


In c programming, explain how do you insert quote characters (? And ?) Into the output screen?

770


What is structure in c language?

627


What do you mean by recursion in c?

634