Shares
facebook sharing button Share
twitter sharing button Tweet
email sharing button Email
linkedin sharing button Share
reddit sharing button Share
tumblr sharing button Share
blogger sharing button Share
print sharing button Print
skype sharing button Share
sms sharing button Share
whatsapp sharing button Share
arrow_left sharing button
arrow_right sharing button

Use of comma operator in C and C++ - Syntax and Example

<<Previous

Next >>





Comma operator is used to separate 2 or more variables or expressions. It has the lowest priority among all other operators.

Comma Operator in C and C++ - Syntax

For example:
     a=17, b=28, c=a+b;

Comma Operator in C Example

#include <stdio.h>
#include <conio.h>

int main()
{
  printf("The Addition :%d\n The Subtraction : %d \n",(2+5),(5-4));
  return(0);

}

Output

The addition : 7
The Subtraction : 1

<< Previous

Next >>




strcat() - String Concatenation        strcmp() - String Compare


strcpy() - String Copy        strlen() - String Length














Use of comma operator in C and C++ - Syntax and Example

<<Previous

Next >>





Comma operator is used to separate 2 or more variables or expressions. It has the lowest priority among all other operators.

Comma Operator in C and C++ - Syntax

For example:
     a=17, b=28, c=a+b;

Comma Operator in C Example

#include <stdio.h>
#include <conio.h>

int main()
{
  printf("The Addition :%d\n The Subtraction : %d \n",(2+5),(5-4));
  return(0);

}

Output

The addition : 7
The Subtraction : 1

<< Previous

Next >>






strncat() - String n Concatenation        strlwr() - String Lower       

strncmp() - String n Compare       strncpy() - String n Copy