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
Can we change the value of #define in c?
What is the purpose of main( ) in c language?
What is a double c?
How pointers are declared?
Write a program to check armstrong number in c?
When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.
What is the difference between a free-standing and a hosted environment?
What is malloc and calloc?
Explain how do you determine whether to use a stream function or a low-level function?
What is the concatenation operator?
How can I trap or ignore keyboard interrupts like control-c?
Explain how can you avoid including a header more than once?
What are 3 types of structures?
A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.
Are global variables static in c?