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
What is the value of uninitialized variable in c?
How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
What is #line in c?
What is void main ()?
What is the use of static variable in c?
Explain how can I manipulate strings of multibyte characters?
How can a number be converted to a string?
What are c identifiers?
Can you tell me how to check whether a linked list is circular?
What are type modifiers in c?
What is type qualifiers?
What is #include cctype?
How to delete a node from linked list w/o using collectons?