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
Which is more efficient, a switch statement or an if else chain?
How to draw the flowchart for structure programs?
Which of these functions is safer to use : fgets(), gets()? Why?
Why does everyone say not to use scanf? What should I use instead?
What is hashing in c?
Should a function contain a return statement if it does not return a value?
How do you initialize pointer variables?
Where can I get an ansi-compatible lint?
In which language linux is written?
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9
What does stand for?
difference between Low, Middle, High Level languages in c ?
What is the advantage of using #define to declare a constant?
the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none
Can an array be an Ivalue?