Multiple choice technology programming languages

main(){ int i=100,j=10,k=20; int sum; float ave; char myformat[]="ave=%.2f"; sum=i+j+k; ave=sum/3; printf(myformat,ave); }

  1. Compile error

  2. ave=43.33

  3. link error

  4. ave= 43.00

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The sum is 100+10+20 = 130. Integer division 130/3 yields 43 (truncates toward zero). This integer is stored in float variable as 43.0, then printf with %.2f format shows 'ave= 43.00'. Option B is wrong because it shows 43.33, which would require floating-point division (130.0/3).