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 / swapnil chhajer

#include<stdio.h>
#include<math.h>
#include<stdlib.h>

int main()
{
int n;
printf("Enter the number : ");
scanf("%d",&n);

(n == (int)sqrt(n) * (int)sqrt(n)) ? printf("YES") :
printf("NO");

fflush(stdin);
getchar();
return 0;
}

Is This Answer Correct ?    6 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)

6721


Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.

1214


What is the difference between union and anonymous union?

1246


What is an endless loop?

1225


What is the maximum no. of arguments that can be given in a command line in C.?

1082


How many levels of indirection in pointers can you have in a single declaration?

1025


What is C language ?

1899


How do I use void main?

1049


#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }

1126


What is the difference between array_name and &array_name?

1237


What do you understand by friend-functions? How are they used?

1155


Explain what are the standard predefined macros?

1069


hi send me sample aptitude papers of cts?

2103


Array is an lvalue or not?

1064


What is volatile variable how do you declare it?

1024