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

Can we change the value of #define in c?

578


What is the purpose of main( ) in c language?

608


What is a double c?

580


How pointers are declared?

554


Write a program to check armstrong number in c?

625






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.

1518


What is the difference between a free-standing and a hosted environment?

634


What is malloc and calloc?

563


Explain how do you determine whether to use a stream function or a low-level function?

616


What is the concatenation operator?

598


How can I trap or ignore keyboard interrupts like control-c?

605


Explain how can you avoid including a header more than once?

589


What are 3 types of structures?

584


A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.

1244


Are global variables static in c?

662