Showing posts with label Odd or Even number. Show all posts
Showing posts with label Odd or Even number. Show all posts

Write a Program that accepts a no & find if odd or even

#include<stdio.h>
#include<conio.h>
void main()
{
  int no;
  clrscr();
  printf("Enter a number");
  scanf("%d",&no);
  if(no%2==0)
  {
    printf("Even number");
  }
  else
  {
    printf("Odd number");
  }
  getch();
}

Related Post

Array:
String functions:
General (Loops-for/while)
Write a Program to print reverse of a given number Write a Program to print Product of Digits (eg. 212=2*1*2=4) of a given number Write a C++ Program to Convert Binary into Decimal Number