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
What is calloc()?
Where is volatile variable stored?
Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
How do you view the path?
Explain the advantages and disadvantages of macros.
What is array of structure in c?
What is pragma c?
How to explain the final year project as a fresher please answer with sample project
Explain how can I avoid the abort, retry, fail messages?
What are valid operations on pointers?
"C" language developed by "Dennis Ritchie" at AT & T. his remarks are a) too general, too abstract b) could deal with only specific problems c) lost generality of BCPL and B restored d) no remarks
What is pragma in c?
What is the difference between fread buffer() and fwrite buffer()?
Write a code to determine the total number of stops an elevator would take to serve N number of people.
What are the applications of c language?