# C Program Add Two Numbers After User Input

Published: 2025-02-26 · By Next-G Classes · Source: https://nextgclasses.com/blog/c-program-add-two-numbers-after-user-input

<strong>Question: Write a Program which ask user to input 2 integers then calculate and print their average?</strong><br /><br />// Online C compiler to run C program online<br />#include &lt;stdio.h&gt;<br />void main()<br />{<br />&nbsp;&nbsp;&nbsp; int a, b, c;<br />&nbsp;&nbsp;&nbsp; printf("Enter the two intgers");<br />&nbsp;&nbsp;&nbsp; scanf("%d %d",&amp;a,&amp;b);<br />&nbsp;&nbsp;&nbsp; c=(a+b)/2;<br />&nbsp;&nbsp;&nbsp; printf("avergae is %d",c);<br />}
