Increment operator – C programming language

2

Increment Operator ………..

If we use increment (++) operator after operand then compiler will work with value of operand and then it will increment by adding 1. If we use before then it will add 1 with value before then work with that value.

#include <stdio.h>
#include<conio.h>
void main()
{
int num;
clrscr();
num=1;
printf(” Using postfix (num++) num=:%d\n”, num++);
printf(” after increment: num=%d\n”, num);
num=1;
printf(” Using prefix (++num) num=:%d\n”, ++num);
printf(” after increment: num=%d\n”, num);
getch();

                                                         —————————- Thanks Everyone

}

Share.

About Author

Chakraborty Prijus

Former Asst. Manager (IT) - MGH Group MCA (Masters in Computer Application) From Sikkim Manipal University India. Have 5 years experience In IT field.

2 Comments

Leave A Reply

Powered by themekiller.com