C Program to find division of two numbers

Share:

Q. – Write a C program to find the Division of given two numbers.

Ans:- Two numbers, says a and b, are given (input) and the result division = a/b of two numbers are to be calculated.



/* Arithmetic Operators Division */
#include <stdio.h>
main()
{
    int a, b, division;
    scanf("%d %d", &a, &b);
    division = a/b;
    printf("%d", division);
    return 0;

}

User Friendly Program


/* Arithmetic Operators Division – User friendly program */
#include<stdio.h>
main()
{
    int a, b, division;
    printf("\n Enter Value to A: ");
    scanf("%d", &a);
    printf("\n Enter Value to B: ");
    scanf("%d", &b);
    division = a/b;
    printf("\n Division = %d", division);
    return 0;

}

No comments