SlideShare a Scribd company logo
MID-TERM PREPARATION
PROGRAMMING FUNDAMENTALS
C++
DAY FIRST LEARNING ALL ABOUT BASICS
What is Algorithm
• step-by-step Procedure to solve a problem
• Using algorithm problem solving become easier
• Its better to write algorithm before writing code
How to Write Algorithm
• Problem broke down into pieces in meaningful steps
• Step should be Numbered
• Step should be Descriptive
• Write in Simple English
More About Algorithm
• Algorithm is write language that is similar to Simple English called Pseudo Code
• It is used to simplify the Program logic
Two Main Parts of Pseudo Code
• Logic Design
Specify different steps
• Coding
Algorithm convert into code
Write a Algorithm input Two Numbers, calculate sum
and display on screen.
Step 1: Start
Step 2: Input A
Step 3: Input B
Step 4: Sum=A+B
Step 5: Display Sum
Step 6: End
Example 2: Determine and Output Whether Number N is Even or Odd.
Step 1: Start
Step 2: Read number N
Step 3: Set remainder as N modulo 2
Step 4: If remainder is equal to 0 then number N is even, else number N is odd
Step 5: Print output.
Step 6: End
Determine Whether A Student Passed the Exam or Not:
Step 1: Start
Step 2: Input grades of 4 courses M1, M2, M3 and M4,
Step 3: Calculate the average grade with formula "Grade=(M1+M2+M3+M4)/4"
Step 4: If the average grade is less than 60, print "FAIL", else print "PASS".
Step 5: End
Advantages of Algorithm
• Reduce Complexity
• Increase Flexibility
• Ease of Understand
What is Flowchart
• A type of diagram that represents an
algorithm
• workflow or process.
• It shows the steps as boxes of various kinds
• and their order by connecting the boxes with
arrows.
• Solution of given problem.
Symbols of Flowchart
Input / Output
Process
Selectio
n
Start / End
Flow Lines
Connectors
Function
Call
Make A Flowchart input Two Numbers, calculate sum and display.
Start
Input
A,B
Sum=A+B
Display
Sum
End
Determine and Output Whether Number N is Even or Odd
Determine Whether A Student Passed the Exam or Not:
Types of Programming Languages
procedural language
That follows, in order, a set of commands
Examples of computer procedural languages are BASIC,
C, FORTRAN and Pascal.
Non-procedural language
That does not require writing traditional programming
logicExamples of computer procedural languages are as C++ or Java
Object-oriented language (OOL)
programming language that implements objects and
their associated procedures within the programming
Examples of Object-oriented language are as php or
Java
High Level Language
• Language that is Near to Human Language and Far from Computer
• Computer Need a translator tom understand it
Low Level Language
• Language that is Near to Computer Language and Far
from Human
• Computer don’t Need a translator tom understand it
Translator
A program who translates from one language into another Language
Types Translator
Compiler
Interpreter
Assembler
Compiler
The Program that convert program High Level Language to
Low Level Language as a whole
It also Check Syntax Error
Interpreter
The Program that convert one Statement at a time
If there is a error stop working and till correct error
Execute first then move on next statement
It also make an object file
Assembler
It also convert program from Assembly Language to Low level Language
Structure of C++ Program
#include<iostream.h>
using namespace std
int main()
{
cout<<“Hello Learn 4 Earn”;
return 0;
}
Header Files
Preprocessor Directives
"std" namespace
Main Function
Body of program
Preprocessor Directives
Preprocessors are programs that process our
source code before compilation
Preprocessor commands begin with a hash symbol (#).
Compiler Directive
Types of Preprocessor Directives
#include
#define
Include header files
Define constant
Header Files
Collection of Library Functions
Include in start of program
Always enclose in < >
Header files always extension .h
Syntax
#include<header_file_name>
A namespace is a declarative region that provides a scope to the identifiers (the names of
types, functions, variables,
namespace
used to organize code into logical groups and to prevent name collisions that can occur
especially when your code base includes multiple libraries
Main Function
the entry point of any C++ program
It is the point at which execution of program is started
When a C++ program is executed, the execution control
goes directly to the main() function.
Without main() program will execute but not compile
Body of Program
In curly braces all the instruction written
Always start with opening brace {
Always End with closing brace }
Braces are known as Delimeters
A C++ identifier is a name used to identify a variable, function, class,
module, or any other user-defined item
Identifiers
Rules For Identifiers
First Character must be Alphabet or Underscore ( _ )
Must consist of only underscore ( _ ) , alphabet or digit
Reserved Word can not use as identifiers
Keywords
Keyword is a predefined or reserved word in C++
library with a fixed meaning and used to perform an internal
operation
C++ Language supports more than 64 keywords
Every Keyword exists in lower case latter
Example
const float short unsigned
continue for signed void
default goto sizeof volatile
do if static while
Data Types
Data type is a keyword used to identify type of data
These are the data types whose variable can hold maximum one value at a time
in C++ language it can be achieve by int, float, double, char.
Primitive data types
These data type are derived from fundamental data type. Variables of
derived data type allow us to store multiple values of same type in one
variable but never allows to store multiple values of different types.
Derived data types
User defined data types related variables allows us to store multiple
values either of same type or different type or both.
User defined data types
Integer
Keyword used for integer data types is int
Integers typically requires 4 bytes of memory space
ranges from -2147483648 to 2147483647
Floating Point
Floating Point data type is used for storing single precision
floating point values or decimal values
Keyword used for floating point data type is float.
Float variables typically requires 4 byte of memory space.
Character
Character data type is used for storing characters
Keyword used for character data type is char
Characters typically requires 1 byte of memory space
ranges from -128 to 127 or 0 to 255
Double Floating Point
Double Floating Point data type is used for storing double
precision floating point values or decimal values
Keyword used for double floating point data type is double
Double variables typically requires 8 byte of memory space
Boolean
Boolean data type is used for storing boolean or logical values
A boolean variable can store either true or false
Keyword used for boolean data type is bool
void
Void means without any value
void datatype represents a valueless entity
Void data type is used for those function which does not
returns a value
Data Type Size (in bytes) Range
short int 2 -32,768 to 32,767
unsigned short int 2 0 to 65,535
unsigned int 4 0 to 4,294,967,295
int 4
-2,147,483,648 to
2,147,483,647
long int 4
-2,147,483,648 to
2,147,483,647
unsigned long int 4 0 to 4,294,967,295
long long int 8 -(2^63) to (2^63)-1
unsigned long long int 8
0 to
18,446,744,073,709,551,615
signed char 1 -128 to 127
unsigned char 1 0 to 255
float 4
double 8
long double 12
wchar_t 2 or 4 1 wide character
where operations on 2 numbers exceeds the maximum
value
Integer overflow
Integer underflow
where operations on 2 numbers decrees the minimum
value
Variables
A variable is a name given to a memory location
It is the basic unit of storage in a program
The value stored in a variable can be changed during
program execution
A variable is only a name given to a memory location
all the operations done on the variable effects that
memory location.
Variables declaration
Process of specifying variable name and Data type
Syntax
Data_Type Variable_Name;
Int number;
Variables Initialization
Process of assigning value to variable at time of declaration
Syntax
Data_Type Variable_Name = value ;
Int number = 10 ;
Rules for Variables declaration
1. A variable name can consist of Capital letters A-Z, lowercase letters a-z, digits 0-
9, and the underscore character.
2. The first character must be a letter or underscore
3. Blank spaces cannot be used in variable names
4. Special characters like #, $ are not allowed.
5. C++ keywords cannot be used as variable names
6. Variable names are case-sensitive.
7. A variable name can be consisting of 31 characters only if we declare a variable
more than one characters compiler will ignore after 31 characters.
8. Variable type can be bool, char, int, float, double, void
or wchar_t
Constant
like a variable, is a memory location where a value can be
storedconstants never change in value
You must initialize a constant when it is created
Way to Create Constant
Using const Keyword
const type variable = value;
const int PI= 3.1415;
Using #define Directive
#define identifier value
#define PI 3.1415
Expression
Expression in C++ is a combination of Operands and
Operators
Evaluate a Single Value
A = 10 , b = 5.0 , c = 4.4 , Result
Result= a+b(a*c) / (a-b)
Example
An operator is a symbol that tells the compiler to perform specific
mathematical or logical manipulations
Operators
Operands are expressions or values on which an operator operates or
works (often constants or variables but sub-expressions are also
permitted).
Operands
1. Arithmetic Operators
a. Unary Operator
b. Binary Operator
2. Relational Operators
3. Logical Operators
4. Assignment Operators
5. Compound Assignment Operators
Types of Operators
These are the operators used to perform arithmetic/mathematical operations on
operands.
Arithmetic operator
Operator Description Example
+ Adds two operands A + B will give 30
-
Subtracts second operand from
the first
A - B will give -10
* Multiplies both operands A * B will give 200
/
Divides numerator by de-
numerator
B / A will give 2
%
Modulus Operator and
remainder of after an integer
division
B % A will give 0
These are used for comparison of the values of two operands.
Relational operator
Also Known as Comparison Operator
Operator Description Example
==
Checks if the values of two operands are
equal or not
(A == B) is not true.
!=
Checks if the values of two operands are
equal or not
(A != B) is true.
>
Checks if the value of left operand is
greater than the value of right operand
(A > B) is not true.
<
Checks if the value of left operand is less
than the value of right operand
(A < B) is true.
>=
Checks if the value of left operand is
greater than or equal to the value of
operand
(A >= B) is not true.
<=
Checks if the value of left operand is less
than or equal to the value of right
operand,
(A <= B) is true.
Logical Operators are used to combine two or more conditions/constraints or to
complement the evaluation of the original condition in consideration. The result of the
operation of a logical operator is a boolean value either true or false
Logical Operator
Operator Description Example
&&
Called Logical AND operator. If
the operands are non-zero, then
condition becomes true.
(A && B) is false.
||
Called Logical OR Operator. If any
the two operands is non-zero, then
condition becomes true.
(A || B) is true.
!
Called Logical NOT Operator. Use to
reverses the logical state of its
operand. If a condition is true, then
Logical NOT operator will make
!(A && B) is true.
Increment operators are used to increase the value of the variable by one .
Increment operators
Prefix Increment
Postfix Increment
Decrement operators
Decrement operators are used to decrease the value of the variable by one.
Prefix Decrement
Postfix Decrement
Assignment Operators
Operator Description Example
=
Simple assignment operator, Assigns
values from right side operands to left
operand.
C = A + B will assign value of A + B into C
+=
Add AND assignment operator, It adds
right operand to the left operand and
assign the result to left operand.
C += A is equivalent to C = C + A
-=
Subtract AND assignment operator, It
subtracts right operand from the left
operand and assign the result to left
operand.
C -= A is equivalent to C = C - A
*=
Multiply AND assignment operator, It
multiplies right operand with the left
operand and assign the result to left
operand.
C *= A is equivalent to C = C * A
/=
Divide AND assignment operator, It
left operand with the right operand and
assign the result to left operand.
C /= A is equivalent to C = C / A
%=
Modulus AND assignment operator, It
takes modulus using two operands and
assign the result to left operand.
C %= A is equivalent to C = C % A
Operator Precedence
operator is a property that determines how operators of the higher and
lower Priority
Category Operator
Parentheses
( )
Division and Multiplication * , /
Plus and Minus + , -
Additive + -
operator is a property that determines how operators of the same precedence
are grouped in the absence of parentheses
Certain operators have higher precedence than others
Operator Associativity
This affects how an expression is evaluated.
Category Operator Associativity
Postfix () [] -> . ++ - - Left to right
Unary + - ! ~ ++ - - (type)* & sizeof Right to left
Multiplicative * / % Left to right
Additive + -
Left to right
Relational < <= > >= Left to right
Equality == !=
Left to right
Category Operator
Associativity
Logical AND
&&
Left to right
Logical OR
||
Left to right
Conditional
?:
Right to left
Assignment
= += -= *= /= %=>>= <<= &= ^=
|=
Right to left
Comma
, Left to right
Operator Associativity
Type Casting
A type cast is basically a conversion from one type to another.
Also known as ‘automatic type conversion’.
Implicit Type Casting
Done by the compiler on its own,
All the data types of the variables are upgraded to the data
type of the variable with largest data type.
bool -> char -> short int -> int -> unsigned int -> long -> unsigned -> long long -> float -> double -> long double
Explicit Type Casting
This process is also called type casting and it is user-defined. Here the
user can typecast the result to make it of a particular data type.
This is done by explicitly defining the required type in front of the expression in
parenthesis. This can be also considered as forceful casting.
Syntax:
(type) expression
double x = 1.2;
int sum = (int)x + 1;
The C++ comments are statements that are not executed by the
compiler.
Comments
The comments in C++ programming can be used to provide
explanation of the code, variable, method or class
C++ Single Line Comment
The single line comment starts with // (double slash). Let's see an
example of single line comment in C++
The C++ multi line comment is used to comment multiple
lines of code. It is surrounded by slash and asterisk (/∗ .....
∗/). Let's see an example of multi line comment in C++.
C++ Multi Line Comment

More Related Content

What's hot

C programming notes
C programming notesC programming notes
C programming notes
Prof. Dr. K. Adisesha
 
C++ Programming Course
C++ Programming CourseC++ Programming Course
C++ Programming Course
Dennis Chang
 
Programming In C++
Programming In C++ Programming In C++
Programming In C++
shammi mehra
 
The smartpath information systems c plus plus
The smartpath information systems  c plus plusThe smartpath information systems  c plus plus
The smartpath information systems c plus plus
The Smartpath Information Systems,Bhilai,Durg,Chhattisgarh.
 
Introduction to C++
Introduction to C++ Introduction to C++
Introduction to C++
Bharat Kalia
 
C++ programming intro
C++ programming introC++ programming intro
C++ programming intromarklaloo
 
basics of c++
basics of c++basics of c++
basics of c++
gourav kottawar
 
C++ for beginners
C++ for beginnersC++ for beginners
C++ for beginners
Salahaddin University-Erbil
 
1 puc programming using c++
1 puc programming using c++1 puc programming using c++
1 puc programming using c++
Prof. Dr. K. Adisesha
 
C by balaguruswami - e.balagurusamy
C   by balaguruswami - e.balagurusamyC   by balaguruswami - e.balagurusamy
C by balaguruswami - e.balagurusamy
Srichandan Sobhanayak
 
Problem solving methodology
Problem solving methodologyProblem solving methodology
Problem solving methodology
Prof. Dr. K. Adisesha
 
Object oriented programming c++
Object oriented programming c++Object oriented programming c++
Object oriented programming c++
Ankur Pandey
 
C++ Basics
C++ BasicsC++ Basics
C++ Basics
Himanshu Sharma
 
Intro. to prog. c++
Intro. to prog. c++Intro. to prog. c++
Intro. to prog. c++
KurdGul
 
Introduction Of C++
Introduction Of C++Introduction Of C++
Introduction Of C++
Sangharsh agarwal
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 Foc
JAYA
 
Keywords, identifiers ,datatypes in C++
Keywords, identifiers ,datatypes in C++Keywords, identifiers ,datatypes in C++
Keywords, identifiers ,datatypes in C++
Ankur Pandey
 

What's hot (20)

C programming notes
C programming notesC programming notes
C programming notes
 
C++ Programming Course
C++ Programming CourseC++ Programming Course
C++ Programming Course
 
Programming In C++
Programming In C++ Programming In C++
Programming In C++
 
The smartpath information systems c plus plus
The smartpath information systems  c plus plusThe smartpath information systems  c plus plus
The smartpath information systems c plus plus
 
C++ ppt
C++ pptC++ ppt
C++ ppt
 
Introduction to C++
Introduction to C++ Introduction to C++
Introduction to C++
 
C++ programming intro
C++ programming introC++ programming intro
C++ programming intro
 
basics of c++
basics of c++basics of c++
basics of c++
 
C++ for beginners
C++ for beginnersC++ for beginners
C++ for beginners
 
1 puc programming using c++
1 puc programming using c++1 puc programming using c++
1 puc programming using c++
 
C by balaguruswami - e.balagurusamy
C   by balaguruswami - e.balagurusamyC   by balaguruswami - e.balagurusamy
C by balaguruswami - e.balagurusamy
 
Problem solving methodology
Problem solving methodologyProblem solving methodology
Problem solving methodology
 
Object oriented programming c++
Object oriented programming c++Object oriented programming c++
Object oriented programming c++
 
C++ Basics
C++ BasicsC++ Basics
C++ Basics
 
Intro. to prog. c++
Intro. to prog. c++Intro. to prog. c++
Intro. to prog. c++
 
Introduction Of C++
Introduction Of C++Introduction Of C++
Introduction Of C++
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 Foc
 
C languaGE UNIT-1
C languaGE UNIT-1C languaGE UNIT-1
C languaGE UNIT-1
 
Keywords, identifiers ,datatypes in C++
Keywords, identifiers ,datatypes in C++Keywords, identifiers ,datatypes in C++
Keywords, identifiers ,datatypes in C++
 
C tutorial
C tutorialC tutorial
C tutorial
 

Similar to C++ Basics introduction to typecasting Webinar Slides 1

Introduction to C
Introduction to CIntroduction to C
Introduction to C
Janani Satheshkumar
 
C programming language
C programming languageC programming language
C programming language
Abin Rimal
 
c programming session 1.pptx
c programming session 1.pptxc programming session 1.pptx
c programming session 1.pptx
RSathyaPriyaCSEKIOT
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
MOHAMAD NOH AHMAD
 
#Code2 create c++ for beginners
#Code2 create  c++ for beginners #Code2 create  c++ for beginners
#Code2 create c++ for beginners
GDGKuwaitGoogleDevel
 
C programming tutorial for Beginner
C programming tutorial for BeginnerC programming tutorial for Beginner
C programming tutorial for Beginner
sophoeutsen2
 
1. overview of c
1. overview of c1. overview of c
1. overview of c
amar kakde
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
Vikram Nandini
 
Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++
Rasan Samarasinghe
 
Esoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingEsoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programming
Rasan Samarasinghe
 
Basic Information About C language PDF
Basic Information About C language PDFBasic Information About C language PDF
Basic Information About C language PDF
Suraj Das
 
1. introduction to computer
1. introduction to computer1. introduction to computer
1. introduction to computer
Shankar Gangaju
 
comp 122 Chapter 2.pptx,language semantics
comp 122 Chapter 2.pptx,language semanticscomp 122 Chapter 2.pptx,language semantics
comp 122 Chapter 2.pptx,language semantics
floraaluoch3
 
C programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer CentreC programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer Centre
jatin batra
 
What is Data Types and Functions?
What is Data Types and Functions?What is Data Types and Functions?
What is Data Types and Functions?
AnuragSrivastava272
 
C#
C#C#
C Sharp Nagina (1)
C Sharp Nagina (1)C Sharp Nagina (1)
C Sharp Nagina (1)
guest58c84c
 
C Sharp Jn (1)
C Sharp Jn (1)C Sharp Jn (1)
C Sharp Jn (1)jahanullah
 

Similar to C++ Basics introduction to typecasting Webinar Slides 1 (20)

Introduction to C
Introduction to CIntroduction to C
Introduction to C
 
C programming language
C programming languageC programming language
C programming language
 
c programming session 1.pptx
c programming session 1.pptxc programming session 1.pptx
c programming session 1.pptx
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
#Code2 create c++ for beginners
#Code2 create  c++ for beginners #Code2 create  c++ for beginners
#Code2 create c++ for beginners
 
C programming tutorial for Beginner
C programming tutorial for BeginnerC programming tutorial for Beginner
C programming tutorial for Beginner
 
1. overview of c
1. overview of c1. overview of c
1. overview of c
 
Pc module1
Pc module1Pc module1
Pc module1
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
 
Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++
 
Esoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingEsoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programming
 
Basic Information About C language PDF
Basic Information About C language PDFBasic Information About C language PDF
Basic Information About C language PDF
 
1. introduction to computer
1. introduction to computer1. introduction to computer
1. introduction to computer
 
comp 122 Chapter 2.pptx,language semantics
comp 122 Chapter 2.pptx,language semanticscomp 122 Chapter 2.pptx,language semantics
comp 122 Chapter 2.pptx,language semantics
 
C programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer CentreC programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer Centre
 
Pengaturcaraan asas
Pengaturcaraan asasPengaturcaraan asas
Pengaturcaraan asas
 
What is Data Types and Functions?
What is Data Types and Functions?What is Data Types and Functions?
What is Data Types and Functions?
 
C#
C#C#
C#
 
C Sharp Nagina (1)
C Sharp Nagina (1)C Sharp Nagina (1)
C Sharp Nagina (1)
 
C Sharp Jn (1)
C Sharp Jn (1)C Sharp Jn (1)
C Sharp Jn (1)
 

Recently uploaded

Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
Roshan Dwivedi
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 

Recently uploaded (20)

Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 

C++ Basics introduction to typecasting Webinar Slides 1

  • 1.
  • 2.
  • 4. What is Algorithm • step-by-step Procedure to solve a problem • Using algorithm problem solving become easier • Its better to write algorithm before writing code How to Write Algorithm • Problem broke down into pieces in meaningful steps • Step should be Numbered • Step should be Descriptive • Write in Simple English
  • 5. More About Algorithm • Algorithm is write language that is similar to Simple English called Pseudo Code • It is used to simplify the Program logic Two Main Parts of Pseudo Code • Logic Design Specify different steps • Coding Algorithm convert into code
  • 6. Write a Algorithm input Two Numbers, calculate sum and display on screen. Step 1: Start Step 2: Input A Step 3: Input B Step 4: Sum=A+B Step 5: Display Sum Step 6: End
  • 7. Example 2: Determine and Output Whether Number N is Even or Odd. Step 1: Start Step 2: Read number N Step 3: Set remainder as N modulo 2 Step 4: If remainder is equal to 0 then number N is even, else number N is odd Step 5: Print output. Step 6: End
  • 8. Determine Whether A Student Passed the Exam or Not: Step 1: Start Step 2: Input grades of 4 courses M1, M2, M3 and M4, Step 3: Calculate the average grade with formula "Grade=(M1+M2+M3+M4)/4" Step 4: If the average grade is less than 60, print "FAIL", else print "PASS". Step 5: End
  • 9. Advantages of Algorithm • Reduce Complexity • Increase Flexibility • Ease of Understand
  • 10. What is Flowchart • A type of diagram that represents an algorithm • workflow or process. • It shows the steps as boxes of various kinds • and their order by connecting the boxes with arrows. • Solution of given problem.
  • 11. Symbols of Flowchart Input / Output Process Selectio n Start / End
  • 13. Make A Flowchart input Two Numbers, calculate sum and display. Start Input A,B Sum=A+B Display Sum End
  • 14. Determine and Output Whether Number N is Even or Odd
  • 15. Determine Whether A Student Passed the Exam or Not:
  • 16. Types of Programming Languages procedural language That follows, in order, a set of commands Examples of computer procedural languages are BASIC, C, FORTRAN and Pascal. Non-procedural language That does not require writing traditional programming logicExamples of computer procedural languages are as C++ or Java Object-oriented language (OOL) programming language that implements objects and their associated procedures within the programming Examples of Object-oriented language are as php or Java
  • 17. High Level Language • Language that is Near to Human Language and Far from Computer • Computer Need a translator tom understand it Low Level Language • Language that is Near to Computer Language and Far from Human • Computer don’t Need a translator tom understand it
  • 18. Translator A program who translates from one language into another Language Types Translator Compiler Interpreter Assembler
  • 19. Compiler The Program that convert program High Level Language to Low Level Language as a whole It also Check Syntax Error
  • 20. Interpreter The Program that convert one Statement at a time If there is a error stop working and till correct error Execute first then move on next statement It also make an object file
  • 21. Assembler It also convert program from Assembly Language to Low level Language
  • 22. Structure of C++ Program #include<iostream.h> using namespace std int main() { cout<<“Hello Learn 4 Earn”; return 0; } Header Files Preprocessor Directives "std" namespace Main Function Body of program
  • 23. Preprocessor Directives Preprocessors are programs that process our source code before compilation Preprocessor commands begin with a hash symbol (#). Compiler Directive Types of Preprocessor Directives #include #define Include header files Define constant
  • 24. Header Files Collection of Library Functions Include in start of program Always enclose in < > Header files always extension .h Syntax #include<header_file_name>
  • 25. A namespace is a declarative region that provides a scope to the identifiers (the names of types, functions, variables, namespace used to organize code into logical groups and to prevent name collisions that can occur especially when your code base includes multiple libraries Main Function the entry point of any C++ program It is the point at which execution of program is started When a C++ program is executed, the execution control goes directly to the main() function. Without main() program will execute but not compile
  • 26. Body of Program In curly braces all the instruction written Always start with opening brace { Always End with closing brace } Braces are known as Delimeters
  • 27. A C++ identifier is a name used to identify a variable, function, class, module, or any other user-defined item Identifiers Rules For Identifiers First Character must be Alphabet or Underscore ( _ ) Must consist of only underscore ( _ ) , alphabet or digit Reserved Word can not use as identifiers
  • 28. Keywords Keyword is a predefined or reserved word in C++ library with a fixed meaning and used to perform an internal operation C++ Language supports more than 64 keywords Every Keyword exists in lower case latter Example const float short unsigned continue for signed void default goto sizeof volatile do if static while
  • 29. Data Types Data type is a keyword used to identify type of data These are the data types whose variable can hold maximum one value at a time in C++ language it can be achieve by int, float, double, char. Primitive data types These data type are derived from fundamental data type. Variables of derived data type allow us to store multiple values of same type in one variable but never allows to store multiple values of different types. Derived data types User defined data types related variables allows us to store multiple values either of same type or different type or both. User defined data types
  • 30.
  • 31. Integer Keyword used for integer data types is int Integers typically requires 4 bytes of memory space ranges from -2147483648 to 2147483647 Floating Point Floating Point data type is used for storing single precision floating point values or decimal values Keyword used for floating point data type is float. Float variables typically requires 4 byte of memory space. Character Character data type is used for storing characters Keyword used for character data type is char Characters typically requires 1 byte of memory space ranges from -128 to 127 or 0 to 255
  • 32. Double Floating Point Double Floating Point data type is used for storing double precision floating point values or decimal values Keyword used for double floating point data type is double Double variables typically requires 8 byte of memory space Boolean Boolean data type is used for storing boolean or logical values A boolean variable can store either true or false Keyword used for boolean data type is bool void Void means without any value void datatype represents a valueless entity Void data type is used for those function which does not returns a value
  • 33. Data Type Size (in bytes) Range short int 2 -32,768 to 32,767 unsigned short int 2 0 to 65,535 unsigned int 4 0 to 4,294,967,295 int 4 -2,147,483,648 to 2,147,483,647 long int 4 -2,147,483,648 to 2,147,483,647 unsigned long int 4 0 to 4,294,967,295 long long int 8 -(2^63) to (2^63)-1 unsigned long long int 8 0 to 18,446,744,073,709,551,615 signed char 1 -128 to 127 unsigned char 1 0 to 255 float 4 double 8 long double 12 wchar_t 2 or 4 1 wide character
  • 34. where operations on 2 numbers exceeds the maximum value Integer overflow Integer underflow where operations on 2 numbers decrees the minimum value
  • 35. Variables A variable is a name given to a memory location It is the basic unit of storage in a program The value stored in a variable can be changed during program execution A variable is only a name given to a memory location all the operations done on the variable effects that memory location.
  • 36. Variables declaration Process of specifying variable name and Data type Syntax Data_Type Variable_Name; Int number; Variables Initialization Process of assigning value to variable at time of declaration Syntax Data_Type Variable_Name = value ; Int number = 10 ;
  • 37. Rules for Variables declaration 1. A variable name can consist of Capital letters A-Z, lowercase letters a-z, digits 0- 9, and the underscore character. 2. The first character must be a letter or underscore 3. Blank spaces cannot be used in variable names 4. Special characters like #, $ are not allowed. 5. C++ keywords cannot be used as variable names 6. Variable names are case-sensitive. 7. A variable name can be consisting of 31 characters only if we declare a variable more than one characters compiler will ignore after 31 characters. 8. Variable type can be bool, char, int, float, double, void or wchar_t
  • 38. Constant like a variable, is a memory location where a value can be storedconstants never change in value You must initialize a constant when it is created Way to Create Constant Using const Keyword const type variable = value; const int PI= 3.1415; Using #define Directive #define identifier value #define PI 3.1415
  • 39. Expression Expression in C++ is a combination of Operands and Operators Evaluate a Single Value A = 10 , b = 5.0 , c = 4.4 , Result Result= a+b(a*c) / (a-b) Example
  • 40. An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations Operators Operands are expressions or values on which an operator operates or works (often constants or variables but sub-expressions are also permitted). Operands 1. Arithmetic Operators a. Unary Operator b. Binary Operator 2. Relational Operators 3. Logical Operators 4. Assignment Operators 5. Compound Assignment Operators Types of Operators
  • 41. These are the operators used to perform arithmetic/mathematical operations on operands. Arithmetic operator Operator Description Example + Adds two operands A + B will give 30 - Subtracts second operand from the first A - B will give -10 * Multiplies both operands A * B will give 200 / Divides numerator by de- numerator B / A will give 2 % Modulus Operator and remainder of after an integer division B % A will give 0
  • 42. These are used for comparison of the values of two operands. Relational operator Also Known as Comparison Operator Operator Description Example == Checks if the values of two operands are equal or not (A == B) is not true. != Checks if the values of two operands are equal or not (A != B) is true. > Checks if the value of left operand is greater than the value of right operand (A > B) is not true. < Checks if the value of left operand is less than the value of right operand (A < B) is true. >= Checks if the value of left operand is greater than or equal to the value of operand (A >= B) is not true. <= Checks if the value of left operand is less than or equal to the value of right operand, (A <= B) is true.
  • 43. Logical Operators are used to combine two or more conditions/constraints or to complement the evaluation of the original condition in consideration. The result of the operation of a logical operator is a boolean value either true or false Logical Operator Operator Description Example && Called Logical AND operator. If the operands are non-zero, then condition becomes true. (A && B) is false. || Called Logical OR Operator. If any the two operands is non-zero, then condition becomes true. (A || B) is true. ! Called Logical NOT Operator. Use to reverses the logical state of its operand. If a condition is true, then Logical NOT operator will make !(A && B) is true.
  • 44. Increment operators are used to increase the value of the variable by one . Increment operators Prefix Increment Postfix Increment Decrement operators Decrement operators are used to decrease the value of the variable by one. Prefix Decrement Postfix Decrement
  • 45. Assignment Operators Operator Description Example = Simple assignment operator, Assigns values from right side operands to left operand. C = A + B will assign value of A + B into C += Add AND assignment operator, It adds right operand to the left operand and assign the result to left operand. C += A is equivalent to C = C + A -= Subtract AND assignment operator, It subtracts right operand from the left operand and assign the result to left operand. C -= A is equivalent to C = C - A *= Multiply AND assignment operator, It multiplies right operand with the left operand and assign the result to left operand. C *= A is equivalent to C = C * A /= Divide AND assignment operator, It left operand with the right operand and assign the result to left operand. C /= A is equivalent to C = C / A %= Modulus AND assignment operator, It takes modulus using two operands and assign the result to left operand. C %= A is equivalent to C = C % A
  • 46. Operator Precedence operator is a property that determines how operators of the higher and lower Priority Category Operator Parentheses ( ) Division and Multiplication * , / Plus and Minus + , - Additive + -
  • 47. operator is a property that determines how operators of the same precedence are grouped in the absence of parentheses Certain operators have higher precedence than others Operator Associativity This affects how an expression is evaluated. Category Operator Associativity Postfix () [] -> . ++ - - Left to right Unary + - ! ~ ++ - - (type)* & sizeof Right to left Multiplicative * / % Left to right Additive + - Left to right Relational < <= > >= Left to right Equality == != Left to right
  • 48. Category Operator Associativity Logical AND && Left to right Logical OR || Left to right Conditional ?: Right to left Assignment = += -= *= /= %=>>= <<= &= ^= |= Right to left Comma , Left to right Operator Associativity
  • 49. Type Casting A type cast is basically a conversion from one type to another. Also known as ‘automatic type conversion’. Implicit Type Casting Done by the compiler on its own, All the data types of the variables are upgraded to the data type of the variable with largest data type. bool -> char -> short int -> int -> unsigned int -> long -> unsigned -> long long -> float -> double -> long double
  • 50. Explicit Type Casting This process is also called type casting and it is user-defined. Here the user can typecast the result to make it of a particular data type. This is done by explicitly defining the required type in front of the expression in parenthesis. This can be also considered as forceful casting. Syntax: (type) expression double x = 1.2; int sum = (int)x + 1;
  • 51. The C++ comments are statements that are not executed by the compiler. Comments The comments in C++ programming can be used to provide explanation of the code, variable, method or class C++ Single Line Comment The single line comment starts with // (double slash). Let's see an example of single line comment in C++ The C++ multi line comment is used to comment multiple lines of code. It is surrounded by slash and asterisk (/∗ ..... ∗/). Let's see an example of multi line comment in C++. C++ Multi Line Comment