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
What’s the special use of UNIONS?
What are the different properties of variable number of arguments?
How does pointer work in c?
Difference between Shallow copy and Deep copy?
Explain what are linked list?
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.
Tell us something about keyword 'auto'.
How can I split up a string into whitespace-separated fields?
How can you find the day of the week given the date?
Explain how do you determine whether to use a stream function or a low-level function?
What is linear search?
how to print the character with maximum occurence and print that number of occurence too in a string given ?
What is pivot in c?
What is the deal on sprintf_s return value?
What is the use of the function in c?