Example & Tutorial understanding programming in easy ways.

What is the difference between %c and %s in C language?

%c - it is used for the only one character.


%s - It is used for the string(collection of char)


program:


void main()

{

char ch='A';

char str[]="Mystring";

printf("%c",ch);

printf("%s",str);
}


output:

A

Mystring

Read More →