Header Ads

Header ADS

scanf and printf

 ..............code..........


#include<stdio.h>

int main()

{

    int a, b, sum, def, mul, div, avg;


    printf("\n\n\n\t......Hello World! Welcome to my code......\n\n");

    printf("\t\tEnter the value of a = ");

    scanf("%d",&a);


    printf("\t\tEnter the value of b = ");

    scanf("%d",&b);


    sum = a + b;

    def = a - b;

    mul = a * b;

    div = a / b;

    avg = sum + 2;


    printf("\n\t\tThe sum of a and b is = %d\n",sum);

    printf("\t\tThe subtract of a and b is = %d\n",def);

    printf("\t\tThe multiplication of a and b is = %d\n",mul);

    printf("\t\tThe quotient of a and b is = %d\n",div);

    printf("\t\tThe average of a and b is = %d\n\n\n\n\n\n",avg);


    return 0;

}


No comments

Theme images by borchee. Powered by Blogger.