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 / vignesh1988i

#include<stdio.h>
#include<conio.h>
void main()
{
int m;
printf("enter the number other than 0 & negative's:");
scanf("%d",&m);
if(m<=0)
printf("%d is a invalid number",m);
else
{
for(int i=0;i<=m/2;i++)
{
if((i*i)==m)
{
printf("yes , %d is a square of a number %d",m,i*i);
break;
}
else
{
printf("it is not a square of any numbers ");
break;
}
}
getch();
}

thank u

Is This Answer Correct ?    12 Yes 19 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What’s the special use of UNIONS?

648


What are the different properties of variable number of arguments?

655


How does pointer work in c?

608


Difference between Shallow copy and Deep copy?

1560


Explain what are linked list?

613






Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.

2641


Tell us something about keyword 'auto'.

655


How can I split up a string into whitespace-separated fields?

560


How can you find the day of the week given the date?

607


Explain how do you determine whether to use a stream function or a low-level function?

616


What is linear search?

668


how to print the character with maximum occurence and print that number of occurence too in a string given ?

2027


What is pivot in c?

559


What is the deal on sprintf_s return value?

631


What is the use of the function in c?

590