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
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)
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.
What is the difference between union and anonymous union?
What is an endless loop?
What is the maximum no. of arguments that can be given in a command line in C.?
How many levels of indirection in pointers can you have in a single declaration?
What is C language ?
How do I use void main?
#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); }
What is the difference between array_name and &array_name?
What do you understand by friend-functions? How are they used?
Explain what are the standard predefined macros?
hi send me sample aptitude papers of cts?
Array is an lvalue or not?
What is volatile variable how do you declare it?