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 / a.ramachandiran b.sc cs

#include<stdio.h>
#include<conio.h>
void main()
{
int m,n,i;
clrscr();
printf("\nEnter a number : ");
scanf("%d",&n);

for(i=1;i<=n/2;i++)
{
if(n==(i*i))
m==1;
else
m==0;
}

if(m==1)
printf("\nGiven number is square of sum");
else
printf("\nGiven number is not square of sum");
getch();
}

Is This Answer Correct ?    3 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is pointers in c?

1161


Why cant I open a file by its explicit path?

1081


Can you apply link and association interchangeably?

1175


write a program to print largest number of each row of a 2D array

2372


What is zero based addressing?

1233


What is a global variable in c?

1071


How can I find out if there are characters available for reading?

1165


how do you programme Carrier Sense Multiple Access

2009


Which is better oop or procedural?

1127


Is return a keyword in c?

1145


Explain what are the standard predefined macros?

1165


FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above

1163


In a switch statement, what will happen if a break statement is omitted?

1115


Which is best book for data structures in c?

1136


What is a function simple definition?

1158