0% found this document useful (0 votes)
19 views3 pages

Compute Quotient and Remainder in C

The document outlines a program aimed at computing the quotient and remainder in division using the C programming language. It provides an overview of Turbo C, steps to run a C program, and details on operators, specifically arithmetic operators. The algorithm for the program is presented along with a conclusion summarizing the learning outcomes related to compiling and executing the program.

Uploaded by

manvisaroj2010
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views3 pages

Compute Quotient and Remainder in C

The document outlines a program aimed at computing the quotient and remainder in division using the C programming language. It provides an overview of Turbo C, steps to run a C program, and details on operators, specifically arithmetic operators. The algorithm for the program is presented along with a conclusion summarizing the learning outcomes related to compiling and executing the program.

Uploaded by

manvisaroj2010
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

PROGRAM 1A

Aim: Write a program to compute Quotient and Remainder in division


operation.
Theory:
 Turbo C:
Turbo C is an integrated development environment (IDE) and compiler for
the C programming language, originally developed by Borland in the late
1980s and 1990s.
It was known for its fast compilation speed, user-friendly interface, and
small size, making it popular for beginners, particularly when it was first
released in 1987; it was later superseded by Turbo C++ which offered
support for C++ programming as well.
 Steps to run a C program in turbo C
Step1: Create a new file.
Step2: Write C program code.
Step3: Save the program using F2 key and give extension as “.c” to your source
code.
Step4: Compile the program using ALT+F9.
Step5: After compilation if any errors are there then fix the errors and again
compile the program till the compilation is successful.
Step6: Run the program using Cntrl+F9.

 Operators in C:
In C language, operators are symbols that represent operations to be
performed on one or more operands. An operator in C can be defined as the
symbol that helps us to perform some specific mathematical, relational,
bitwise, conditional, or logical computations on values and variables. The
values and variables used with operators are called operands. So we can say
that the operators are the symbols that perform operations on operands.
C language provides a wide range of operators. Binary operators are classified
further as:
1. Arithmetic Operators
2. Relational Operators
3. Logical Operators
4. Bitwise Operators
5. Assignment Operators
 Arithmetic operator:
The arithmetic operators are used to perform arithmetic/mathematical
operations on operands. There are 5 arithmetic operators in C language:
Plus (+), Minus (-), Multiplication (*), Division (/), Modulus (%)

Algorithm:
Input: Two integers
Output: Quotient and Remainder
Step1: Start
Step2: Declare 4 integer variables x, y, q and r.
Step3: Get first number from the user using printf().
Step4: Save the number in x variable using scanf().
Step5: Get second number from the user using printf().
Step6: Save the number in y variable using scanf().
Step7: Calculate and save quotient as x/y in q variable
Step8: Print quotient using printf()
Step9: Calculate and save remainder as x%y in r variable
Step 10: Print remainder.
Step 11: Stop.
Flowchart:

Conclusion:
Thus we studied how to compile and execute a C program. We also studied
how to use arithmetic operator / and % in the program and calculated quotient
and remainder of two numbers.

You might also like