Translate

Tuesday, May 12, 2020

check whether a given number is even or odd? If the number is an even number, print it's square.


C program to check whether a given number is even or odd? if the number is even number, print it's square...

#include<stdio.h>
#include<conio.h>
void main()
{
    int num, squ;
    printf("enter number = ");
    scanf("%d",& num);
    if(num%2==0)
       { 
           printf("The number is Even");
           squ = num*num;
           printf("\nsquare of this even number is %d", squ);
       }
          
    else 
         printf("The number is Odd");
         
    getch();


}
Output:






Click Here for, All Important Questions with Answers
Click here for, C Programs


1 comment:

  1. Great blog very simple and easy to understand for beginners.Programs are written in such a way that any one can easily understand it. Good work

    ReplyDelete

C program to make a calculator using the switch statement.

/*perform arithmetic calculation on integers in C language*/ #include<stdio.h> #include<conio.h> void main() {     char op;     ...