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 are header files and what are its uses in C programming?
How does #define work?
What is the difference between typedef and #define?
What are different types of operators?
What is the difference between #include
What do header files do?
Explain enumerated types.
Which header file is essential for using strcmp function?
What does printf does?
What is FIFO?
What are the advantages of using Unions?
All technical questions
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402
What is the purpose of 'register' keyword?
An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above