C Program To Find Division Of Two Numbers

 

C Program To Find Division of two numbers

In this example, you will learn to calculate Division Of Two Numbers Using printf() And scanf() Functions.

How Program Works ??

This Program Can Be Run By Two Ways (1) Using printf() Or (2) Using scanf() 

We Use (/) Operators To Calculate Division

If You Entered a=10 And B=5 Then

It Represent As div = a / b;

where a = 10 , b = 5 And Answers Which Div = 2;

Code For  " Division Of Two Numbers ", Using  printf() Function.

/* Author --> HARSH PATEL */

#include<stdio.h>
void main()
{
    int a = 10; //You Can Add Any Number
    int b = 5; //You Can Add Any Number

    int c = a / b; //Now int C Calculate division Of Two Numbers Which You Added On a & b

    printf("Division Of Two Numbers = %d",c);
}
OUTPUT For "Division Of Two Numbers ", Using  printf()  Function.

Division Of Two Numbers = 2



Now Using 

scanf()

 Function.


Now Code For  " Find Division Of Two Numbers ", Using  scanf() Function.

/* Author --> HARSH PATEL */

#include<stdio.h>
int main()
{
    int a,b,div;
    printf("Enter First Number : ");
    scanf("%d",&a);
    printf("Enter Second Number : ");
    scanf("%d",&b);

    div = a / b;

    printf("Division Of Two Numbers = %d",div);
return 0; }
OUTPUT For "Division Of Two Numbers ", Using  scanf() Function.

Enter First Number : 10
Enter Second Number : 5
Division Of Two Numbers = 2
  • Now Program End Without Any Error.
🖥️ Learn Programming Languages Free In Our Website Coding With Harsh 
👨‍🎓 5000+ Happy Visitor 👩‍🎓
🌐 Free Programing Examples In WebsitCoding With Harsh 

  • If Any Query Regarding Programs, Website Or More Details Email Us On Contact@CodingWithHarsh.gq

Popular posts from this blog

C Program To Print Hello World

C Program To Find Sum Of Two Numbers