Sunday, 21 January 2018

Program for Even or Odd


Program for Even or Odd
/*check even or odd*/
#include<stdio.h>
#include<conio.h>
main()
{
int a;
clrscr();
printf("enter the value of a");
scanf("%d",&a);
if(a%2==0)
{
printf("%d is even",a);
}
else
printf("%d is odd",a);
getch();

}

Related Posts:

  • The NOT(!) Operators The NOT(!) Operators So far we have used only the logical operators && and ||.Third operator is the Not operator, written as !. This operator reverses the result of the expression it operates on.For example,if th… Read More
  • Parameter Passing Technique Parameter Passing Technique The parameter passing mechanism refers to the actions taken regarding the parameters when a function is invoked. There are two parameter passing techniques available in C. They are: 1) Call B… Read More
  • Case Control Structure(SWITCH) Case Control Structure(SWITCH) Introduction:           In real life we are often faced with situations where we are required to make a choice between a number of  alternatives rather than on… Read More
  • Introduction To Functions Introduction To Functions Functions are building blocks of C. The general form of C (User-defined) function is:       Return-type-function-name(parameter list)       parameter declaration &… Read More
  • GO TO Statement GO TO Statement This Keyword is used when we want to transfer the control to some point in the program which is not in the normal, step by step sequence of a program.  It takes control from one place to another un… Read More

0 comments:

Post a Comment