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 / satya
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
int r,n,s;
printf("Enter the number : ");
scanf("%d",&s);
n=sqrt(s);
r=n*n;
if(r==n)
printf("%d is a square of %d ",s,n);
else
printf("%d is not a square number",s);
Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
Are pointers integer?
Why is it that not all header files are declared in every C program?
writ a program to compare using strcmp VIVA and viva with its output.
What is the acronym for ansi?
What are enums in c?
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)
Why c language is called c?
Explain what is the stack?
How is = symbol different from == symbol in c programming?
Is Exception handling possible in c language?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
how to find binary of number?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
What is getch() function?
What is c programming structure?