Sunday, March 19, 2023

"find the average of two given numbers " using c .

//find the average of two given numbers
#include <stdio.h>
int main (){
    int num1,num2 ;
    float avr;
    printf ("enter two numbers :");
    scanf ("%i%i",&num1,&num2);
    avr =(float)(num1+num2)/2;
    printf ("the value of average of two  numbers is :%.2f",avr);
    return 0;
}

No comments:

Post a Comment

print a multiplication table of any integer taking from user

 // print a multiplication table of any integer taking from user  #include "stdio.h" int main () { int n,mul,i; printf ("...