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
When should the register modifier be used? Does it really help?
Where is c used?
Explain Function Pointer?
What is output redirection?
What is the purpose of & in scanf?
Why is it that not all header files are declared in every C program?
A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles
What is assert and when would I use it?
What is #define size in c?
What does != Mean in c?
What is dangling pointer in c?
Can we declare function inside main?
Why do we use header files in c?
Why do we use pointer to pointer in c?
What is c language & why it is used?