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


Please Help Members By Posting Answers For Below Questions

What is the explanation for modular programming?

689


write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?

2415


What is the difference between near, far and huge pointers?

630


a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none

631


The file stdio.h, what does it contain?

670






Explain why c is faster than c++?

578


what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)

1932


When was c language developed?

706


application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above

610


Define and explain about ! Operator?

617


how we can make 3d venturing graphics on outer interface

4016


Explain how do you determine a file’s attributes?

596


Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.

1573


Write a program to use switch statement.

662


What is a const pointer in c?

674