1,106 views
3 votes
3 votes

1 Answer

Best answer
4 votes
4 votes

program flow  ...

step 1..(11)->if(true) ((11/2=5)*10+11%2=1)  ......>STEP 5.  101*10+1=1011   answer

STEP 2.(11/2=5) ->if(true) (5/2=2)*10+5%2=1)......> STEP 6.  10*10+1=101

STEP 3.  (5/2=2)->if(true)   (2/2=1)*10+2%2=0)  .....>  STEP 7.   1*10+0=10

STEP 4.  (2/2=1)->if(false) return 1 ......now keep on putting the value...

selected by

Related questions

0 votes
0 votes
2 answers
1
Debargha Mitra Roy asked Apr 10
122 views
What is the output of the below code?#include <stdio.h void main() { static int var = 5; printf("%d ", var ); if (var) main(); }a. 1 2 3 4 5b. 1c. 5 4 3 2 1d. Error
3 votes
3 votes
3 answers
2
Laxman Ghanchi asked May 19, 2023
1,177 views
#include<stdio.h void print(int n) { printf("Hello "); if(n++ == 0) return ; print(n); n++; } int main() { void print(); print(-4); }How many times printf execute?? And H...
0 votes
0 votes
1 answer
3
Laxman Ghanchi asked May 19, 2023
693 views
#include<stdio.h>void print(int n){ printf("Hello "); if(n++ == 0) return ; print(n); n++;}int main(){ void print(); print(-4);}
2 votes
2 votes
4 answers
4
gate_forum asked Mar 16, 2017
1,473 views
output of program:void function(int); void main() { function(3); } void function(int num){ if(num>0) { function( num); printf("%d",num); function( num); } }will the argum...