The following program (myprog) is run from the command line as my prog 123 what would be the output? main {int argc, char argv(]) [int i, j =0 for (i =o; ii < argc; i ++) j=j+atoi(argv [i]); printf("%d",j);] }
A
123
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
6
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
Error
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
D
"123"
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution
The correct option is B Error The output will be error. Because given that in the loop i=0 but it does not given that where i will be goes. So, j did not mentioned clearly.