Thursday 28 February 2019

c program for cheak given number is even or odd

πŸ˜ƒc program for check given number is even or odd.

if number is divisible by 2 and reminder is zero then given number is even 
otherwise given number is odd
eg.i am enter number 12 the it print the given number is even
     


//first include header files 

#include<stdio.h>
#include<conio.h>

void main()
{
         int no;
         printf("enter number\n");
          scanf("%d",&no);//here we can take number form user
          if(no%2==0)

       {
                printf("the given number is even\n")l
       }
      else
      {
               printf("given number is odd\n");
        }
        getch();

}

output   →  enter number
                    12 
                    the given number is even


THANKS  ...πŸ‘†


No comments:

Post a Comment

SQL Assignment-1 Library System

        Library System if any one want answers of following questions send messege on         instagram  id link      click here  πŸ‘‰  ...