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 void c?
Write a program which returns the first non repetitive character in the string?
Is there sort function in c?
What does the format %10.2 mean when included in a printf statement?
What are the features of c language?
Why c is procedure oriented?
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above
#include main() { int *p, *c, i; i = 5; p = (int*) (malloc(sizeof(i))); printf(" %d",*p); *p = 10; printf(" %d %d",i,*p); c = (int*) calloc(2); printf(" %d ",*c); }
Is main a keyword in c?
explain what is an endless loop?
What is equivalent to ++i+++j?
Ow can I insert or delete a line (or record) in the middle of a file?
what is the height of tree if leaf node is at level 3. please explain
What are types of preprocessor in c?
Does c have circular shift operators?