Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 is a stream water?

1127


C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions

1002


How can I recover the file name given an open stream or file descriptor?

1030


What's the right way to use errno?

1087


Write a Program to find whether the given number or string is palindrome.

1228


What is the size of a union variable?

999


How many parameters should a function have?

1127


What is the difference between printf and scanf )?

1023


What does sizeof function do?

1126


What is the difference between printf and scanf in c?

1285


Are there any problems with performing mathematical operations on different variable types?

991


Is c easier than java?

999


What is meant by operator precedence?

1096


The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration

1038


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.

1215