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
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
When would you use a pointer to a function?
Explain the use of bit fieild.
How do we make a global variable accessible across files? Explain the extern keyword?
What is the difference between far and near in c?
write a c program to calculate sum of digits till it reduces to a single digit using recursion
Is c a great language, or what?
please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code
What is sizeof return in c?
a program that can input number of records and can view it again the record
how can f be used for both float and double arguments in printf? Are not they different types?
The __________ attribute is used to announce variables based on definitions of columns in a table?
In c programming, explain how do you insert quote characters (? And ?) Into the output screen?
What is structure in c language?
What do you mean by recursion in c?