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 are terms in math?
What is the difference between arrays and pointers?
What is a structure member in c?
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?
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.
Does * p ++ increment p or what it points to?
Differentiate between null and void pointers.
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.
What is include directive in c?
Who is the founder of c language?
What language is c written?
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.
Give differences between - new and malloc() , delete and free() ?
How can I implement sets or arrays of bits?
what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?