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:

  • Difference Between The Macros And Functions Difference Between The Macros And Functions Macros are like functions but there is difference between those two . 1. In macro call the processor replaces the macro template with its macro expansion. Where as in functi… Read More
  • Defining And Opening A File Defining And Opening A File  If we want to store data in a file in the secondary memory, we must specify certain things about the file , to the operating system. They include:  1.File name.  2.Data Structu… Read More
  • Enumerated Data Type Enumerated Data Type     This is one of the user defined datatypes. The use of this datatype is to make programs more readable.It allows you to create your own datatype with predefined values. Though its form … Read More
  • Inroduction To PreProcessors Inroduction To PreProcessors INTRODUCTION:     The C preprocessor is a program that processes our source program before it is passed to the compiler.This is a  capability that does not exist in many other … Read More
  • Closing A File & File Functions Closing A File & File Functions When we have finished all operations the file must be closed . This ensures that all outstanding information associated with the file is flushed out from the buffers and all links to… Read More

0 comments:

Post a Comment