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
Explain what are compound statements?
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.
Difference between constant pointer and pointer to a constant.
What is c language and why we use it?
What is an lvalue in c?
Explain what is a stream?
What is c programing language?
Is c is a procedural language?
If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above
which is conditional construct a) if statement b) switch statement c) while/for d) goto
write a program to find the given number is prime or not
Why double pointer is used in c?
What is clrscr in c?
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2