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
Why do we use main function?
How do you generate random numbers in C?
What is extern keyword in c?
Calculate 1*2*3*____*n using recursive function??
Write a program to print factorial of given number using recursion?
What is oops c?
Explain what is wrong with this statement? Myname = ?robin?;
5 Write an Algorithm to find the maximum and minimum items in a set of ānā element.
What are different types of variables in c?
What are qualifiers and modifiers c?
int i=10; printf("%d %d %d", i, i=20, i);
Write a program to identify if a given binary tree is balanced or not.
Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?
What are valid operations on pointers?
Is c high or low level?