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 / swapnil chhajer
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
int n;
printf("Enter the number : ");
scanf("%d",&n);
(n == (int)sqrt(n) * (int)sqrt(n)) ? printf("YES") :
printf("NO");
fflush(stdin);
getchar();
return 0;
}
| Is This Answer Correct ? | 6 Yes | 4 No |
Post New Answer View All Answers
What is hashing in c?
Why is event driven programming or procedural programming, better within specific scenario?
How can you tell whether two strings are the same?
Write a program for finding factorial of a number.
Can we change the value of constant variable in c?
Explain enumerated types.
The __________ attribute is used to announce variables based on definitions of columns in a table?
Write a C program to help a HiFi’s Restaurant automate its breakfast billing system. Your assignment should implement the following items: a. Show the customer the different breakfast items offered by the HiFi’s Restaurant. b. Allow the customer to select more than one item from the menu. c. Calculate and print the bill to the customer. d. Produce a report to present your complete program and show more sample output. Assume that the HiFi’s Restaurant offers the following breakfast menu: Plain Egg $2.50 Bacon and Egg $3.45 Muffin $2.20 French Toast $2.95 Fruit Basket $3.45 Cereal $0.70 Coffee $1.50 Tea $1.80
Can you write the algorithm for Queue?
What is pass by reference in c?
please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code
Are bit fields portable?
What is malloc and calloc?
What is union and structure in c?
How do you sort filenames in a directory?