Skip to main content
SEE CS 2083 LEARN • PRACTICE • SUCCEED 🔍

Saturday, March 6, 2021

📚 SEE COMPUTER SCIENCE • CDC 2083

C program to find the average of any two numbers given by the user.

📅 Updated learning resource Quick read 📱 Mobile friendly

 

 

1.     Write a C program to find the average of any two numbers given by the user.

 

#include<stdio.h>

#include<conio.h>

int main()

{

    int a,b;

    float c;

    printf("Enter first number: ");

    scanf("%d", &a);

    printf("Enter second number: ");

    scanf("%d", &b);

    c=(a+b)/2;

    printf("Average of two numbers= %.2f",c);

    return 0;

}

No comments:

Post a Comment

Home 📖Chapters 🎯Quiz MCQs 🔍Search