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 / satya
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
int r,n,s;
printf("Enter the number : ");
scanf("%d",&s);
n=sqrt(s);
r=n*n;
if(r==n)
printf("%d is a square of %d ",s,n);
else
printf("%d is not a square number",s);
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
What is the process to generate random numbers in c programming language?
Explain built-in function?
how to print the character with maximum occurence and print that number of occurence too in a string given ?
What is this pointer in c plus plus?
how to find binary of number?
What are integer variable, floating-point variable and character variable?
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
What is static volatile in c?
Is there a way to switch on strings?
Explain About fork()?
Explain what are compound statements?
What is the difference between #include and #include 'file' ?
Explain what are reserved words?
the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above
In which header file is the null macro defined?