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
Apart from dennis ritchie who the other person who contributed in design of c language.
How do you redirect a standard stream?
Simplify the program segment if X = B then C ← true else C ← false
If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above
What is cohesion in c?
What is the maximum length of an identifier?
What will be your course of action for a push operation?
I need previous papers of CSC.......plz help out by posting them.......
What is the difference between char array and char pointer?
Write a program for Overriding.
what is different between auto and local static? why should we use local static?
What is 1f in c?
How does #define work?
What is define c?
What is ambagious result in C? explain with an example.