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


Please Help Members By Posting Answers For Below Questions

What are terms in math?

595


What is the difference between arrays and pointers?

637


What is a structure member in c?

551


If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

781


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.

1499






Does * p ++ increment p or what it points to?

619


Differentiate between null and void pointers.

634


Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.

686


What is include directive in c?

647


Who is the founder of c language?

687


What language is c written?

578


You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.

1784


Give differences between - new and malloc() , delete and free() ?

613


How can I implement sets or arrays of bits?

608


what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?

1455