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 / vignesh1988i

#include<stdio.h>
#include<conio.h>
void main()
{
int m;
printf("enter the number other than 0 & negative's:");
scanf("%d",&m);
if(m<=0)
printf("%d is a invalid number",m);
else
{
for(int i=0;i<=m/2;i++)
{
if((i*i)==m)
{
printf("yes , %d is a square of a number %d",m,i*i);
break;
}
else
{
printf("it is not a square of any numbers ");
break;
}
}
getch();
}

thank u

Is This Answer Correct ?    12 Yes 19 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you be sure that a program follows the ANSI C standard?

1555


How can I find out the size of a file, prior to reading it in?

1097


What is the difference between int main and void main in c?

1090


Explain how do you determine whether to use a stream function or a low-level function?

1022


With the help of using classes, write a program to add two numbers.

981


Can we use any name in place of argv and argc as command line arguments?

1009


Are enumerations really portable?

976


What is a char in c?

928


Can we declare a function inside a function in c?

986


How do you define a string?

1043


#include main() { int *p, *c, i; i = 5; p = (int*) (malloc(sizeof(i))); printf(" %d",*p); *p = 10; printf(" %d %d",i,*p); c = (int*) calloc(2); printf(" %d ",*c); }

1002


What are reserved words with a programming language?

1053


Explain what happens if you free a pointer twice?

1011


What is wild pointer in c?

1011


Explain how can you tell whether a program was compiled using c versus c++?

1049