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

Why do we use main function?

1234


How do you generate random numbers in C?

1246


What is extern keyword in c?

1184


Calculate 1*2*3*____*n using recursive function??

2096


Write a program to print factorial of given number using recursion?

1060


What is oops c?

1339


Explain what is wrong with this statement? Myname = ?robin?;

1637


5 Write an Algorithm to find the maximum and minimum items in a set of ā€˜n’ element.

2158


What are different types of variables in c?

1126


What are qualifiers and modifiers c?

1059


int i=10; printf("%d %d %d", i, i=20, i);

1693


Write a program to identify if a given binary tree is balanced or not.

1228


Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?

1176


What are valid operations on pointers?

1260


Is c high or low level?

1052