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 / vrushali
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main ()
{
int num = 0;
int sqr = 0;
while (1)
{
printf ("\n Enter the no for finding sqaure root ");
scanf ("%d",&num);
if (num==0)
break;
else
{
sqr = sqrt(num);
if (num/sqr == sqr)
printf ("\n Number's sqaure root %d",sqr);
else
break;
}
}
return 0;
}
~
| Is This Answer Correct ? | 1 Yes | 8 No |
Post New Answer View All Answers
What is pointer in c?
What is 1d array in c?
Explain goto?
program for reversing a selected line word by word when multiple lines are given without using strrev
Calculate the weighted average of a list of n numbers using the formula xavg = f1x1+f2x2+ ….+ fnxn where the f’s are fractional weighting factors, i.e., 0<=fi<1, and f1+f2+….+fn = 1
application attempts to perform an operation?
What are the differences between Structures and Arrays?
What is a function simple definition?
What is printf () in c?
Simplify the program segment if X = B then C ← true else C ← false
Is it possible to execute code even after the program exits the main() function?
Write a program to check prime number in c programming?
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
what are # pragma staments?
we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above