#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);
}
Chat with our AI personalities
Write a program in c++ that take input in a integer matrix of size 4*4 and find out if the entered matrix is diagonal or not.
By using that one thing.
It doesn't have length, but you can use sizeof to find out its size.
Reference:cprogramming-bd.com/c_page1.aspx# array programming
I assume you mean is an if the number is an integer multiple of 3i am unfamiliar with C but the theory would be,find if a is integer multiple of 3b=a/3b==round(b).if 1 "yes"else "no"this is an inefficiency way but will get the job done