Write a program to accept three marks and print the average using type qualifier.

/* Write a program to accept three marks and print the average

using type qualifier.*/

#include <stdio.h>

void main()

{

    int m1,m2,m3;

    float avg;

    printf("Enter the mark1 : ");

    scanf("%d",&m1);

    printf("Enter the mark2 : ");

    scanf("%d",&m2);

    printf("Enter the mark3 : ");

    scanf("%d",&m3);

    avg=(m1+m2+m3)/3.0;

    printf("The average is %.2f\n",avg);

    getch();

}

Comments

Popular posts from this blog

Write a program to accept numerator and denominator and find the remainder without using modulus (%) operator using do..while loop.