lab sheet 6

PHOTO EMBED

Mon Dec 05 2022 08:07:30 GMT+0000 (Coordinated Universal Time)

Saved by @Mohamedshariif

//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;
content_copyCOPY