# C Program Add Two Float Numbers After User Input

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

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