C program for Unary Operators:
#include<stdio.h>
#include<conio.h>
main(){
int a=9;
clrscr();
printf("\na=%d",a);
printf("\na=%d",a++);
printf("\na=%d",a);
printf("\na=%d",++a);
printf("\na=%d",a);
printf("\na=%d",a--);
printf("\na=%d",a);
printf("\na=%d",--a);
printf("\na=%d",a);
getch();
}
#include<stdio.h>
#include<conio.h>
main(){
int a=9;
clrscr();
printf("\na=%d",a);
printf("\na=%d",a++);
printf("\na=%d",a);
printf("\na=%d",++a);
printf("\na=%d",a);
printf("\na=%d",a--);
printf("\na=%d",a);
printf("\na=%d",--a);
printf("\na=%d",a);
getch();
}
No comments:
Post a Comment