Comma Operator in C | C Comma Operator - C Programming Tutorial 34

preview_player
Показать описание
Notes for You:: Comma operator in C.
- is used to group related expressions together.
- it returns the result of the rightmost expression.

Syntax:
(expression1, expression2, …. , rightmost expression)

Ex: C Program to find addition of 2 numbers using comma operator.

#include <stdio.h>
int main()
{
int a=0, b=0, c=0;
c = (a=10, b=20, c=a+b);
printf("c= %d\n", c); // C= 30
return 0;
}

Notes:
- replace < with less-than symbol.
- replace > with greater-than symbol.

=========================================

Follow the link for next video:
C Programming Tutorial 35 - Address Of ( Reference ) Operator in C Programming Language

Follow the link for previous video:
C Programming Tutorial 33 - sizeof Operator in C Programming Language

=========================================

C Programming Tutorials Playlist:

=========================================
Watch My Other Useful Tutorials:-

Computer Programming Fundamentals Playlist:-

C Practical LAB Exercises Playlist:-

C++ Tutorials Playlist:

=========================================

► Subscribe to our YouTube channel:

► Visit our Website:

=========================================
Hash Tags:-
#ChidresTechTutorials #CProgramming #CProgrammingTutorial
Рекомендации по теме
Комментарии
Автор

Answer the following questions: Let's see who gives the best answer
1. What is the purpose of comma operator in C ?

ChidresTechTutorials
Автор

Do you have tutorials liek this for JavaScript and Python? You are so good at explaining everything...

tristiandejong
Автор

Sir kindly make videos on java script.
I could not find out best tutorial for java script

AbdulBasit-expw
Автор

Hi Chidre,
I have another question.. Why do you add an address to each memory location when you are explaining it in paint?

Thnx

tristiandejong