Search Blog

Sunday, January 30, 2022

How to do Addition, Subtraction, Multiplication, Division and Modulus of ANY Two Numbers?

            Here We Will Learn To Program C. I'll try To give my Best To Make you understand.

                                                               "Let's Begin"

A program to do Addition, Subtraction, Multiplication,
Division and Modulus of ANY Two Numbers



Lets Understand It.

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

    void main()

    {}
    This is the Starting of Nearly Every Programme.
    In this # is Preprocessor Directives used to Include a header File.
    stdio.h stands for Standard Input Output Header File and conio.h  stands for Console Input Output Header File. 
    stdio.h includes function like printf(),scanf(),etc.
    conio.h
    includes function like clrscr(),getch(),etc.
    void main()
    means starting pf main programme.
    "{}" program must be written in Between of curly brackets. 
  • clrscr() stands for Clear screen,used to clear screen.If we don't write it then we can see the old Output.
  • int a,b,c; here int stant for Integer And Allow only Numerical data to be Entered in a b and c.
    a,b and c represent  Variables.Variable  is a address or storage where the Data is Stored.
  • printf("Enter Two Numbers:- "); .printf stands for print file.
  • scanf("%d%d",&a,&b); .scanf is used to take Input From User. It is Very Important to Make Your Data User Friendly.
    %d specifies type of Data Ex 12,234,etc. %d for Whole Number Data(-infinity to +infinity),%f for Float Data(Decimal Data),%c is for Character Data(a to z ,A to Z) And Many More.  is used as address of a and b.
  • c is used to perform every Operation(+ Addition,- Subtraction, * Multiplication, / Division,% Modulus(Remainder)) on Two variables.Value of c is changed every time.
  • printf("Add or Sub or Div or Mul or Mod of Numbers:-%d \n",c); . %d specifies type of Data and Telss that c will print HERE.\n is used to print the data in next line. 
  • getch() stands for get character. It is important to see output or it is used to stop screen on output screen.
                            

OUTPUT



Download Link Of Above Programme:-

How to Use it.
Download File >Go To Turboc3(or turboc folder)>bin>Paste File>
open Turbo c Application>File>open(or F3)>Select File
 
NOTE:- Above File Can Be Opened With Other Compilers(Like code blocks, visual studio, etc.), Some Changes Might Require.

THANKS

No comments:

Post a Comment

How to Add Two Array(or Matrix) ?

    Here We Will Learn To Program C. I'll try To give my Best To Make you understand.                                                   ...