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
What is pointers in c?
Why cant I open a file by its explicit path?
Can you apply link and association interchangeably?
write a program to print largest number of each row of a 2D array
What is zero based addressing?
What is a global variable in c?
How can I find out if there are characters available for reading?
how do you programme Carrier Sense Multiple Access
Which is better oop or procedural?
Is return a keyword in c?
Explain what are the standard predefined macros?
FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above
In a switch statement, what will happen if a break statement is omitted?
Which is best book for data structures in c?
What is a function simple definition?