Print special characters in C programming


#1

I want to print % between my name e.g. “dee%pak” in C programming how I can print this string in C program.


#2
printf("%s%s","dee%","pak");

#3

This is the correct answer:
printf("%s%s",“dee%”,“pak”)


#4

You can print % between your name in many ways in c programming.
now we see the programme for printing % between the name deepak as dee%pak

#include<stdio.h>
int main()
{
char a[10]=“dee%”;
char b[10]=“pak”;
printf("%s%s",a,b);
return 0;
}
output: dee%pak
OR
you can also do this in another different way ,i.e. printing the word in the way we want.

#include<stdio.h>
int main()
{
printf(“dee%%pak”);
return 0;
}