Day#77 'C' Coding Challenge

Day#77 'C' Coding Challenge

Is the below code valid? What is the output?

#include <stdio.h> void main() { int i, num_1 = 1, num_2 = 2; for (i=0; i<10; i++, sum(num_1,num_2)) { } } void sum(int num_1,int num_2) { printf("%d",num_1+num_2); }

------------------------------------------------------------------

Yes, the code is valid. The instructions separated by , shall be executed without any issues as is is valid. In the program, post every increment operation, sum(num_1,num_2) are called and correspondingly the output shall be printed. the output shall be 3 and is printed 10 times.

Access all the other questions from below link:

http://forum.talenteve.com/viewforum.php?f=46

Post a Comment

0 Comments