answersLogoWhite

0

#include
#include
void main()
{
long int n;
printf("Please enter the number");
scanf("%ld" ,&n);
n=n*n;
printf("Square of entered number = %ld ");
}

but if you want to show the entered number e.g.Square of the entered number 8=64

then below is the code.

#include
#include
void main()
{
long int m,n;
printf("Please enter the number");
scanf("%ld" ,&n);
m=n;
n=n*n;
printf("Square of entered number %ld = %ld ",m,n);
}

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

MaxineMaxine
I respect you enough to keep it real.
Chat with Maxine
RossRoss
Every question is just a happy little opportunity.
Chat with Ross
JudyJudy
Simplicity is my specialty.
Chat with Judy

Add your answer:

Earn +20 pts
Q: C program to find square of an integer?
Write your answer...
Submit
Still have questions?
magnify glass
imp