Preview:
//first question:

void aveTwo(float n1,float n2);
int main() {
   
    float num1, num2;
    float avg;

    printf("Enter first number: ");
    scanf("%f",&num1);
    printf("Enter second number: ");
    scanf("%f",&num2);

    avg= (float)(num1+num2)/2;

    //%.2f is used for displaying output upto two decimal places
    printf("Average of %f and %f is: %.2f",num1,num2,avg);


    return 0;
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter