Search This Blog

Saturday, 16 May 2020

programming C(avarage)

two decimal numbers avarage


#include<stdio.h>
int main()
{
    float x,y,z;
    printf("enter the first decimal:\n");
    scanf("%f", &x);
    printf("enter the second decimal:\n");
    scanf("%f", &y);
    z=(x+y)/2;
    printf("avarage is: %.2f", z);
    return 0;
}

   

No comments:

Post a Comment

please wait...