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

main()
{
int i,b,j;
printf("enter the no");
scanf("%d",&i);
for(j=1;j<i;j++)
{
b=j*j;
if(i==b)
{
printf("this no is squre of: %d",j);
return;
}
}
printf("not a square no");
}

Is This Answer Correct ?    1 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to show the change in position of a cursor using c

565


What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file

651


What are types of functions?

551


What is a stream water?

638


i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....

1508






What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

716


how to capitalise first letter of each word in a given string?

1415


How can a number be converted to a string?

586


Explain what is the difference between a free-standing and a hosted environment?

622


What is sizeof c?

588


What do you mean by dynamic memory allocation in c?

635


Is c call by value?

590


What is null character in c?

671


Is c procedural or object oriented?

561


Why is #define used?

783