Rédigé par des étudiants ayant réussi Disponible immédiatement après paiement Lire en ligne ou en PDF Mauvais document ? Échangez-le gratuitement 4,6 TrustPilot
logo-home
Examen

Basic arithmatic using c++

Note
-
Vendu
-
Pages
8
Grade
B
Publié le
01-07-2025
Écrit en
2024/2025

Simple and beginner-level questions covering addition, subtraction, multiplication, division, and modulus using C++. Ideal for new learners starting with programming and basic logic building.

Établissement
Cours

Aperçu du contenu

LAB # 02: Basic Arithmetic using C++

Lab Objective:
The main objective of this lab is to introduce students to the fundamentals of basic arithmetic
operations in C++. Students will learn how to perform basic arithmetic operations such as
addition, subtraction, multiplication, and division using C++ programming. By the end of the
lab, students will gain practical experience in using variables, operators, and control structures to
implement simple arithmetic calculations.

Hardware/Software Tools:
 Hardware: Desktop/Computer
 Software Tool: MS Visual Studio 2013

Lab Description:
This lab focuses on implementing basic arithmetic operations in C++ programming. The students
will start by understanding the role of data types and variables to store numerical values and use
appropriate operators to perform basic arithmetic tasks. The lab will cover various arithmetic
operators such as addition (+), subtraction (-), multiplication (*), and division (/). Finally, the
students will use input/output functions to display the results clearly and in a user-friendly
format, reinforcing their skills in coding and debugging C++ programs.

Arithmetic Operators:

Arithmetic operations are performed using operators that allow you to manipulate numbers in
various ways. These operations include addition, subtraction, multiplication, and division. When
writing a program, you can use the arithmetic operators +, -, *, and / to carry out these
calculations. For example, the addition operator + adds two numbers together, the subtraction
operator - subtracts one number from another, the multiplication operator * multiplies two
numbers, and the division operator / divides one number by another.

Command Name Example Output

+ Addition 4+5 9

- Subtraction 8-5 3

* Multiplication 4*5 20

/ Division 19/3 6

% Remainder 19%3 5




1

, 1. Addition (+): The addition operator is used to add two values together. For example:




This example/code defines two integer variables, a and b, with values 5 and 3,
respectively. It then adds them together, stores the result in the variable result, and
displays the sum to the console.



2. Subtraction (-): The subtraction operator is used to subtract one value from another. For
example:




This code/example defines two integer variables, a and b, with values 5 and 3,
respectively. It then subtracts b from a, stores the result in the variable result, and
displays the difference to the console.




2

École, étude et sujet

Cours

Infos sur le Document

Publié le
1 juillet 2025
Nombre de pages
8
Écrit en
2024/2025
Type
Examen
Contient
Seulement des questions

Sujets

$8.49
Accéder à l'intégralité du document:

Mauvais document ? Échangez-le gratuitement Dans les 14 jours suivant votre achat et avant le téléchargement, vous pouvez choisir un autre document. Vous pouvez simplement dépenser le montant à nouveau.
Rédigé par des étudiants ayant réussi
Disponible immédiatement après paiement
Lire en ligne ou en PDF

Faites connaissance avec le vendeur
Seller avatar
hadiqagulzar

Faites connaissance avec le vendeur

Seller avatar
hadiqagulzar NUST College of Electrical & Mechacical Engineering
S'abonner Vous devez être connecté afin de suivre les étudiants ou les cours
Vendu
-
Membre depuis
9 mois
Nombre de followers
0
Documents
9
Dernière vente
-

0.0

0 revues

5
0
4
0
3
0
2
0
1
0

Documents populaires

Récemment consulté par vous

Pourquoi les étudiants choisissent Stuvia

Créé par d'autres étudiants, vérifié par les avis

Une qualité sur laquelle compter : rédigé par des étudiants qui ont réussi et évalué par d'autres qui ont utilisé ce document.

Le document ne convient pas ? Choisis un autre document

Aucun souci ! Tu peux sélectionner directement un autre document qui correspond mieux à ce que tu cherches.

Paye comme tu veux, apprends aussitôt

Aucun abonnement, aucun engagement. Paye selon tes habitudes par carte de crédit et télécharge ton document PDF instantanément.

Student with book image

“Acheté, téléchargé et réussi. C'est aussi simple que ça.”

Alisha Student

Foire aux questions