Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

ATM machine and railway reservation class/object diagram

5253


Why isn't any of this standardized in c? Any real program has to do some of these things.

1213


Is there anything like an ifdef for typedefs?

1154


difference between object file and executable file

6726


what is the function of pragma directive in c?

1123


What are the types of data structures in c?

1155


What is the difference between procedural and declarative language?

1145


What is clrscr ()?

1110


What does double pointer mean in c?

1180


Explain how can you tell whether a program was compiled using c versus c++?

1103


Do you have any idea how to compare array with pointer in c?

1052


What is pointer and structure in c?

1184


What is main function in c?

1081


about c language

2016


What is string function in c?

985