Question: 1. What is the output of the below code snippet? int a = 7, b = 8, c = 4; if(a =b) printf(%d , (a+b));
1.
What is the output of the below code snippet?
int a = 7, b = 8, c = 4;
if(a=b)
printf("%d ", (a+b));
else
printf(%d,(b-c));
a.
-1
b.
5
c.
15
d.
4
2.
The size of the string for the given string declaration is ____________.
char str[ ]=MUSCAT;
a.
No size
b.
3
c.
7
d.
6
3.
The size of the string for the given string declaration is ____________.
char str[ ]=HAPPY;
a.
5
b.
4
c.
6
d.
No size
4.
What is the value in string st1[] of the below code snippet? char st1 [] =SultanateOf;char st2 [] =Oman;strcpy(st1,st2);
a.
SultanateOf
b.
Oman
c.
SultanateOfOman
d.
OmanSultanateOf
5.
What is the value in sz as per the following given statements ?
char nm[]=MICHAEL;
sz=strlen(nm);
a.
0
b.
4
c.
6
d.
7
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
