C Programming Examples with Output Part – 5
Program
C Programming Examples with Output Part – 5 ~ Image by ©Ishwaranand |
1) what is the output of the following program? If the user inputs the values as AMRAVATI NAGPUR YAVATMAL
void main()
{
char a, b, c;
scanf(“%c%c%c”, &a, %b, &c);
printf(“a=%c b=%c c=%c”, a, b, c);
}
Output:
a = A b = M c = R
{
char a, b, c;
scanf(“%c%c%c”, &a, %b, &c);
printf(“a=%c b=%c c=%c”, a, b, c);
}
Output:
a = A b = M c = R
2) what is the output of the following program? – Increment decrement
# include <stdio.h>
void main()
{
int a=7;
void main()
{
int a=7;
printf(“”%d””, a++);
printf(“”n%d””, a++ * a++);
printf(“”n%d””, ++a *++a);
}
output:
7
72
132
printf(“”n%d””, a++ * a++);
printf(“”n%d””, ++a *++a);
}
output:
7
72
132
Last updated on Friday - May 26th, 2023