write a c program to find the square of even number
Answers
Answered by
0
#include<stdio.h>
#include<conio.h>
main()
{
int n,ans;
printf("Enter an even number:");
scanf("%d" , &n);
if( n%2 == 0){
ans = n*n;
printf("square of entered number is",ans);
}
else
printf("Please Enter an even number");
}
Answered by
0
Answer:
#include<constream.h>
void main()
{
clrscr();
int a, sq;
cout<<"\n Enter any number:";
cin>>a;
if(a%2==0)
{
sq=a*a;
cout<<"\n Square of even number="<<sq;
}
else
{
cout<<"\nNumber is odd";
}
getch();
}
Similar questions