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 a stream water?
C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions
How can I recover the file name given an open stream or file descriptor?
What's the right way to use errno?
Write a Program to find whether the given number or string is palindrome.
What is the size of a union variable?
How many parameters should a function have?
What is the difference between printf and scanf )?
What does sizeof function do?
What is the difference between printf and scanf in c?
Are there any problems with performing mathematical operations on different variable types?
Is c easier than java?
What is meant by operator precedence?
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.