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


Please Help Members By Posting Answers For Below Questions

Are pointers integer?

539


Why is it that not all header files are declared in every C program?

664


writ a program to compare using strcmp VIVA and viva with its output.

1507


What is the acronym for ansi?

616


What are enums in c?

645






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)

673


Why c language is called c?

557


Explain what is the stack?

621


How is = symbol different from == symbol in c programming?

595


Is Exception handling possible in c language?

1564


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

1988


how to find binary of number?

3400


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

1873


What is getch() function?

632


What is c programming structure?

606