Search This Blog

Friday, October 7, 2011

Write a Program to find a Number is Even or Odd – C Program

   1:  #include<stdio.h>
   2:  #include<conio.h>
   3:   
   4:  void main()
   5:  {
   6:  int n;
   7:  printf("Enter an integer No:");
   8:  scanf("%d",&n);
   9:  if(n%2==0)
  10:  printf("%d is even num",n);
  11:  if(n%2!=0)
  12:  printf("%d is odd num",n);
  13:  getch();
  14:  }
 
Output
Enter an Interger No: 4
4 is even num
 

2 comments:

  1. write a program that display an asterisk pyramid form.. like this..

    *
    **
    ***
    ****
    *****

    ReplyDelete
  2. write a program that display an asterisk pyramid form.. like this..

    *
    **
    ***
    ****
    *****

    Here's The solution

    http://programs-hangout.blogspot.com/2011/10/write-program-that-display-asterisk.html

    ReplyDelete