Shares
print sharing button Print
twitter sharing button Tweet
facebook sharing button Share
whatsapp sharing button Share
pinterest sharing button Pin
email sharing button Email
flipboard sharing button Flip
sharethis 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