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 the memory area not included in C program? give the reason
what do the 'c' and 'v' in argc and argv stand for?
What is an lvalue?
What are the two types of functions in c?
What is meant by int main ()?
I just typed in this program, and it is acting strangely. Can you see anything wrong with it?
Iam a B.Tech graduate and completed my engineering in 2009, from 2005 to 2009 and after that i had done nothing.Now i want to do job and get into BPO field . Friends give me suggestions as what to say in interview... if they ask me that what would you had done ... these many years without doing job ??????? pls urgent
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
What do you mean by recursion in c?
Who invented b language?
What does the message "automatic aggregate intialization is an ansi feature" mean?
Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.
Can you return null in c?
Is c is a middle level language?
What are compound statements?