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

What is the value of uninitialized variable in c?

578


How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?

616


void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1263


When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?

591


What is #line in c?

565






What is void main ()?

616


What is the use of static variable in c?

597


Explain how can I manipulate strings of multibyte characters?

787


How can a number be converted to a string?

611


What are c identifiers?

631


Can you tell me how to check whether a linked list is circular?

776


What are type modifiers in c?

625


What is type qualifiers?

666


What is #include cctype?

582


How to delete a node from linked list w/o using collectons?

2091