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

Saturday, March 6, 2021

📚 SEE COMPUTER SCIENCE • CDC 2083

C program to calculate the average of three numbers.

📅 Updated learning resource Quick read 📱 Mobile friendly

 

1.     Write a C program to calculate the average of three numbers.

 

#include<stdio.h>

#include<conio.h>

int main()

{

    int a,b,c;

    float d;

    printf("Enter first number: ");

    scanf("%d", &a);

    printf("Enter second number: ");

    scanf("%d", &b);

    printf("Enter second number: ");

    scanf("%d", &c);

    d=(a+b+c)/3;

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

    return 0;

}

No comments:

Post a Comment

Home 📖Chapters 🎯Quiz MCQs 🔍Search