sum and avg using void

 #include <stdio.h>


void sum_avg( float a , float b , float * sum , float * avg){

    *sum = a + b;

    *avg =((a+b)/2) ; 

}


int main() {

    // Write C code here

    float a =4 , b= 5 , sum , avg ; 

    sum_avg( a , b , &sum , &avg); 

    

    

    printf("Sum and avg is %f and  %f " , sum , avg);

    

    return 0;

}

Comments

Popular posts from this blog

Sum of Even Numbers till N

Find the Runner-Up Score!

Print All Substrings