Arithmetic Operator - Basic C Programming Solve
Problems…
1. (a) Write a program that read two integer and display sum.
(b) Write a program that read two floating point and display sum.
2. Write a program that subtracts two integer.
3. Write a program that read two integer and display product.
4. (a) Write a program that divide two integer.
(b) Write a program that divide two floating point
5. Write a program that read two integer and display reminder.
6. Write a program that read radius of a circle and display its area.
7. Write a program to demonstrate the working of increment and decrement operators.
SOLVED BY
Md. Masudur Rahman
Department of Textile Engineering
4th Batch
National Institute of Textile Engineering and Research (NITER)
masudbdasia@gmail.com
Operator : Operators in C program is special symbol or word which directs the compiler to perform arithmetical or logical works, i.e. the characters which is used in C for special purpose so this character is called operators.
Different types of operators :
* Arithmetic operator
* Unary operator
* Relational operator
* Logical operator
Arithmetic
Operators niterians.blogspot.com
Operator
Meaning
+
Addition or unary plus
-
Subtraction or unary minus
*
Multiplication
/
Division
%
Modulo division
++
Increment operator increases the integer value
by one.
--
Decrement operator decreases the integer
value by one.
* Assignment operator
* Conditional operator
* Arithmetic Operators List :
* Arithmetic expressions:
An arithmetic expression is a combination of variables, constants, and operators.
For example,
(1) (b) Write a program that read two floating point and display sum.
2) Write a program that subtracts two integer.
2) Write a program that subtracts two integer
3) Write a program that read two integer and display product.
(4) (a) Write a program that divide two integer.
(4) (b) Write a program that divide two floating point
(4) (b) Write a program that divide two floating point
5) Write a program that read two integer and display reminder.
(6) (a) Write a program that read radius of a circle and display its area.
(6) (b) Write a program that read radius of a circle and display its area
(6) (b) Write a program that read radius of a circle and display its area
(6) (c) Write a program that read radius of a circle and display its area
7) Write a program to demonstrate the working of increment and decrement operators.
Arithmetic Operator - Basic C Programming Solve niterians.blogspot.com
The best way to learn C programming is by practicing examples. This ppt contains examples on basic concepts of C programming. You are advised to take the references from these examples and try them on your own.
All the programs on this ppt are tested and should work on all platforms.
Structure Computer Programming with C-02 by Alamgir Hossain
Topics Covered: Introduction of a C program with Proper Exam. From this slide you will learn all about a c program.
The best way to learn C programming is by practicing examples. This ppt contains examples on basic concepts of C programming. You are advised to take the references from these examples and try them on your own.
All the programs on this ppt are tested and should work on all platforms.
Structure Computer Programming with C-02 by Alamgir Hossain
Topics Covered: Introduction of a C program with Proper Exam. From this slide you will learn all about a c program.
Get the best collection of plus size lingeries which are guaranteed to steam up the room at great prices. Log into saucyladiesintimates.com right now to dive into the best deals.
C is a powerful general-purpose programming language. It can be used to develop software like operating systems, databases, compilers, and so on. C programming is an excellent language to learn to program for beginners.
C is a high level programming language developed by Dennis Ritchie in 1972 at AT and T Bell Laboratories, New Jersey, USA to develop the UNIX operating system.
This is a presentation on C language. Brief description on C language
Topics Covered
What is C
Header files in C
What is main function in c
Basic Structure of C
Keywords & Identifiers
Data Types & Variable Declaration in C Includes | Format Specifier | Memory Size
Input in C (printf() scanf() function)
Operators in C: Asthmatics,Increment Decrement, Relational, Logical operators
Sample Exercise
LinkedIn: https://www.linkedin.com/in/shamsulhusainansari/
GitHub: https://github.com/shamsulhusainansari
Fundamental of C Programming Language and Basic Input/Output Functionimtiazalijoono
Fundamental of C Programming Language
and
Basic Input/Output Function
contents
C Development Environment
C Program Structure
Basic Data Types
Input/Output function
Common Programming Error
The Art Pastor's Guide to Sabbath | Steve ThomasonSteve Thomason
What is the purpose of the Sabbath Law in the Torah. It is interesting to compare how the context of the law shifts from Exodus to Deuteronomy. Who gets to rest, and why?
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
The Indian economy is classified into different sectors to simplify the analysis and understanding of economic activities. For Class 10, it's essential to grasp the sectors of the Indian economy, understand their characteristics, and recognize their importance. This guide will provide detailed notes on the Sectors of the Indian Economy Class 10, using specific long-tail keywords to enhance comprehension.
For more information, visit-www.vavaclasses.com
Ethnobotany and Ethnopharmacology:
Ethnobotany in herbal drug evaluation,
Impact of Ethnobotany in traditional medicine,
New development in herbals,
Bio-prospecting tools for drug discovery,
Role of Ethnopharmacology in drug evaluation,
Reverse Pharmacology.
How to Split Bills in the Odoo 17 POS ModuleCeline George
Bills have a main role in point of sale procedure. It will help to track sales, handling payments and giving receipts to customers. Bill splitting also has an important role in POS. For example, If some friends come together for dinner and if they want to divide the bill then it is possible by POS bill splitting. This slide will show how to split bills in odoo 17 POS.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
This is a presentation by Dada Robert in a Your Skill Boost masterclass organised by the Excellence Foundation for South Sudan (EFSS) on Saturday, the 25th and Sunday, the 26th of May 2024.
He discussed the concept of quality improvement, emphasizing its applicability to various aspects of life, including personal, project, and program improvements. He defined quality as doing the right thing at the right time in the right way to achieve the best possible results and discussed the concept of the "gap" between what we know and what we do, and how this gap represents the areas we need to improve. He explained the scientific approach to quality improvement, which involves systematic performance analysis, testing and learning, and implementing change ideas. He also highlighted the importance of client focus and a team approach to quality improvement.
1. Arithmetic Operator - Basic C Programming Solve niterians.blogspot.com
Page1
Arithmetic Operator - Basic C Programming Solve
Problems…
1. (a) Write a program that read two integer and display sum.
(b) Write a program that read two floating point and display sum.
2. Write a program that subtracts two integer.
3. Write a program that read two integer and display product.
4. (a) Write a program that divide two integer.
(b) Write a program that divide two floating point
5. Write a program that read two integer and display reminder.
6. Write a program that read radius of a circle and display its area.
7. Write a program to demonstrate the working of increment and
decrement operators.
SOLVED BY
Md. Masudur Rahman
Department of Textile Engineering
4th Batch
National Institute of Textile Engineering and Research (NITER)
masudbdasia@gmail.com
2. Arithmetic Operator - Basic C Programming Solve niterians.blogspot.com
Page2
Operator :Operators in C program is special symbol or word which directs the
compiler to perform arithmetical or logical works, i.e. the characters which is used in C
for special purpose so this character is called operators.
Different types of operators :
Arithmetic operator
Unary operator
Relational operator
Logical operator
Assignment operator
Conditional operator
Arithmetic Operators List :
Arithmetic Operators niterians.blogspot.com
Operator Meaning
+ Addition or unary plus
- Subtraction or unary minus
* Multiplication
/ Division
% Modulo division
++ Increment operator increases the integer value
by one.
-- Decrement operator decreases the integer
value by one.
3. Arithmetic Operator - Basic C Programming Solve niterians.blogspot.com
Page3
Arithmetic expressions:
An arithmetic expression is a combination of variables, constants, and
operators.
For example,
Arithmetic expressions: niterians.blogspot.com
a*b-c a*b-c
(m+n)(x+y) (m+n)*(x+y)
ax2
+bx+c a*x*x+b*x+c
1) (a) Write a program that read two integer and display sum.
#include <stdio.h>
int main ()
{
int a, b, c;
printf("Enter the value of a : ");
scanf("%d", &a);
printf("Enter the value of b : ");
scanf("%d", &b);
c =a+b;
printf("Sum of a and b is %d ", c);
}
4. Arithmetic Operator - Basic C Programming Solve niterians.blogspot.com
Page4
(1) (b) Write a program that read two floating point and display sum.
2) Write a program that subtracts two integer.
#include <stdio.h>
int main ()
{
float a, b, c;
printf("Enter the value of a : ");
scanf("%f", &a);
printf("Enter the value of b : ");
scanf("%f", &b);
c =a+b;
printf("Sum of a and b is %f ", c);
}
#include <stdio.h>
int main ()
{
int a, b, c;
printf("Enter the value of a :");
scanf("%d", &a);
printf("Enter the value of b :");
scanf("%d", &b);
c =a-b;
printf("a - b = %d", c);
}
5. Arithmetic Operator - Basic C Programming Solve niterians.blogspot.com
Page5
2) Write a program that subtracts two integer
3) Write a program that read two integer and display product.
#include <stdio.h>
int main ()
{
int a, b, c;
printf("Enter the value of a : ");
scanf("%d", &a);
printf("Enter the value of b : ");
scanf("%d", &b);
c =a*b;
printf("Product of a and b is %d ", c);
}
6. Arithmetic Operator - Basic C Programming Solve niterians.blogspot.com
Page6
(4) (a) Write a program that divide two integer.
(4) (b) Write a program that divide two floating point
#include <stdio.h>
int main ()
{
int a, b, c;
printf("Enter the value of a: ");
scanf("%d", &a);
printf("Enter the value of b: ");
scanf("%d", &b);
c =a/b;
printf("a divide b is = %d", c);
}
#include <stdio.h>
int main ()
{
float a, b, c;
printf("Enter the value of a: ");
scanf("%f", &a);
printf("Enter the value of b: ");
scanf("%f", &b);
c =a/b;
printf("a divide b is = %f", c);
}
7. Arithmetic Operator - Basic C Programming Solve niterians.blogspot.com
Page7
(4) (b) Write a program that divide two floating point
5) Write a program that read two integer and display reminder.
#include <stdio.h>
int main ()
{
int a, b, c;
printf("Enter the value of a: ");
scanf("%d", &a);
printf("Enter the value of b: ");
scanf("%d", &b);
c =a%b;
printf("Remainder = %d", c);
}
8. Arithmetic Operator - Basic C Programming Solve niterians.blogspot.com
Page8
(6) (a) Write a program that read radius of a circle and display its area.
(6) (b) Write a program that read radius of a circle and display its area
#include <stdio.h>
void main ()
{
float r, area;
printf("Enter the radius : ");
scanf("%f", &r);
area = 3.1416*r*r;
printf("The area of the circle is: %f", area);
}
#include <stdio.h>
#define pi 3.1416
void main ()
{
float r, area;
printf("Enter the radius : ");
scanf("%f", &r);
area = pi*r*r;
printf("The area of the circle is: %f", area);
}
9. Arithmetic Operator - Basic C Programming Solve niterians.blogspot.com
Page9
(6) (b) Write a program that read radius of a circle and display its area
(6) (c) Write a program that read radius of a circle and display its area
#include <stdio.h>
#define pi 3.1416
void main ()
{
float r, area;
printf("Enter the radius : ");
scanf("%f", &r);
area = pi*r*r;
printf("The area of the circle is: %f", area);
}
10. Arithmetic Operator - Basic C Programming Solve niterians.blogspot.com
Page10
7) Write a program to demonstrate the working of increment and
decrement operators.
#include <stdio.h>
int main()
{
int a, c;
float b, d;
printf("a = ");
scanf("%d", &a);
printf("b = ");
scanf("%f", &b);
printf("c = ");
scanf("%d", &c);
printf("d = ");
scanf("%f", &d);
printf("++a = %d n", ++a);
printf("--b = %f n", --b);
printf("++c = %d n", ++c);
printf("--d = %f n", --d);
return 0;
}