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
ATM machine and railway reservation class/object diagram
Why isn't any of this standardized in c? Any real program has to do some of these things.
Is there anything like an ifdef for typedefs?
difference between object file and executable file
what is the function of pragma directive in c?
What are the types of data structures in c?
What is the difference between procedural and declarative language?
What is clrscr ()?
What does double pointer mean in c?
Explain how can you tell whether a program was compiled using c versus c++?
Do you have any idea how to compare array with pointer in c?
What is pointer and structure in c?
What is main function in c?
about c language
What is string function in c?