Professional Documents
Culture Documents
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
y=++x;
y=--x;
getch();
}
1) Write a C program to demonstrate the usage of postfix increment/decrement operator
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
y=x++;
y=x--;
printf("\n\n After Decrementing by 1 \n X = %d",x);
printf("\n Y = %d",y);
getch();
}
int num;
void main()
{
clrscr();
if(num%2 == 0)
{
printf("\n\n Entered Number is an Even Number!");
}
else if(num%2 != 0)
{
printf("\n\n Entered Number is an Odd Number!");
}
getch();
}
3) Write a C Program to read the values of x and y and print the results of the following
expression (x+y)/(x-y)
#include<stdio.h>
#include<conio.h>
int x,y,res;
void main()
{
clrscr();
res = (x+y)/(x-y);
getch();
}