In my previous post, I wrote about Multiplying two numbers in C. We are doing a too much of simple math here. Let’s code a program to divide two numbers in C. Now to divide two numbers in C, we just have to use the “/” operator instead of other math operators we used before. If you are unsure about any part and more information, put it down in the comments section below or look it up on Google if you want quick response.  We will try to get back to you as soon as we see the comment.

Download the source code:

Download Program

Algorithm to divide two numbers in C:

1) Start

2) Accept Number one

3) Accept Number two

4) Divide both the numbers

5) Print the result.

6) End

Program to divide two numbers in C:

/*Program to divide two numbers in C.
Programmer: Harsh Shah, Date: 29/6/13*/

#include<stdio.h>
#include<conio.h>

void main(){

int one, two, div;

printf("Enter first number - ");

scanf("%d",&one);

printf("Enter second number - ");

scanf("%d",&two);

div = one / two;

printf("The divison of numbers %d and %d is %d",one,two,div);

getch();

}
//End of the program.

Output:

Enter first number – 22

Enter second number – 11

The divison of numbers 22 and 11 is 2

So this was, the program to add two numbers in C.

Download Code

Download Program

Read Also:

Introduction to C Programming

Adding two numbers in C

Subtracting two numbers in C

Multiplying two numbers in C

Harsh Shah

Harsh Shah

A highly motivated individual with a hunger to learn and share as much as I can about everything. Masters in Interaction Design with a Bachelors in Computer Science. I have worked with clients across the globe on various design and tech projects. I believe in giving back and that's how ReadMeNow was founded.

Leave a Reply