Question: Which code segment is the same as the following code secment ? int m = 4 0 , n = 2 0 ; if (

Which code segment is the same as the following code secment?
int m =40,n =20;
if (m > n)
printf("m is greater than n
");
else if(m < n)
printf("m is less than n
");
else
printf("m is equal to n
");
if (m > n){
printf("m is greater than n
");}
if (m < n){
printf("m is less than n
");
else
printf("m is equal to n
");}
char str[100];
strcpy(str,(m > n)?"--m is greater than n" :
((m < n)?"--m is less than n" :
"--m is equal to n"));
printf("%s
", str);
if (m > n){
printf("m is greater than n
");
else if(m < n)
printf("m is less than n
"); }
else
printf("m is equal to n
");
strcpy(str,(m > n)?((m < n)?"--m is less than n" : "--m is greater than n") :
"--m is equal to n";
printf("%s
", str);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!