//Write a function called aveTwo that will //1- take two floating point numbers as input //2- calculates the average of two numbers //3- prints the result on the screen //Hint: the function header will be //void aveTwo(float n1,float n2) #include <stdio.h> #include <stdlib.h> #include <math.h> void aveTwo(float number1,float number2); int main() { float number1,number2; printf("please enter number 1: "); scanf("%f",&number1); printf("please enter number 2: "); scanf("%f",&number2); float ave = (number1+number2) / 2.0; printf("the avrage of number1 and number2 is %f\n",(number1+number2)/2.0); return 0; }
Preview:
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