avg and sum

 #include <stdio.h>


float avg_sum( float a , float b ){

    float c = a+b ;

    float d = (a+b)/2 ; 

    

    

    printf("sum is  %f\n", c );

    printf("avg is  %f\n", d );

    return ; 

    

}


int main() {

    // Write C code here

    float a , n ;

    printf(" enter value of a : ");

    scanf("%f",&a);

    printf(" enter value of n : ");

    scanf("%f",&n);

    avg_sum(a , n);

    

    

     

    

    

    

   

    

    return 0;

}

Comments

Popular posts from this blog

Sum of Even Numbers till N

Find the Runner-Up Score!

Print All Substrings