Knowledge Walls
Venkatesan
Hyderabad, Andhra Pradesh, India
Passcode:
Introduction [cont'd]
Input Output Functions [cont'd]
Structures and Unions [cont'd]
# Preprocessor [cont'd]
Comma operator in Operators of Programming in C
1450 Views
Comma(,) Operator 
Comma operator used to seperate variable while declaring variable. It is used join multiple expressions together. Comma seperated expressions are evaluated in left to right direction and right most value will assign to the variable.
Program Hints 
a assign the value as 10, b assign the value as 20 and final expression adding both and added value return to c variable.
Program
#include
void main(){
   int a,b;
   int c;
   c = (a=10,b=20,a+b);
   printf("%d+%d=%d",a,b,c);
}
Output 
10+20=30
Previous Topics
Previous lessons of current book.
Introduction of Programming in C
Introduction of Programming in C
Introduction of Programming in C
Best Lessons of "Programming in C"
Top lessons which are viewed more times.
Structures and Unions of Programming in C
Input Output Functions of Programming in C
Structures and Unions of Programming in C
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details