# What is the meaning of program?
The some commands which understood by the computer to perform a given task .
# Programming languages are divided into:
1. Low level languages.
That is called language machine or assembly language, It is characterized as
the fastest scripting language in execution because it does not need an
compiler , But its flaws are difficult to detect errors and difficult to deal
with because they consist of two numbers only zero and one .
2. High level languages.
Characterized by one instruction does a lot of tasks, So
that takes a fewer lines, but this language need to
compiler And take a more time than the assembly.
Variables
Other Components
Loops
Input& Output
Conditions
# language components :
Numerical
variables
character
Variables
Intger Char
Float
• Type :
VariablesType
# Variables .
It is an empty area of memory , It
has three characteristics :
• Name : Language is characterized by the
distinction between large letters and
lowercase letters .
• Value : the user is enter it .
# Flow chart component .
START & End
Data entry
Opreation
Print Data
Comprtor
# Steps to solve any problem .
1. Start .
2. Reserved variables .
3. Data entry .
4. Make operation .
5. Print the result .
6. End .
جماربلاو داوكلاا هباتكىفهغل
# Write aprogramto add 5 + 15 and print the result .
نيمقرلا عمجي جمانرب بتكأ (15 +5)جتانلا ةعابطب مقو
Solution :
#include <iostream.h> ءاعدتساب موقيهبتكملاهصاخلاهمجرتبجمانربلا مهفو
Void main ( ) هيادبهلادلاهيساسلاا
{ سوقهيادبجمانربلا
Int sum ; ريغتم زجحىمقر حيحص
Sum = 5 + 15 ; ريغتملا لخادب جتانلا ظفحو نيمقرلا عمجب رملاا موقي
Cout<< " the result = " ; رملاا موقيراهظابهلمجلاهروصحملانيسوقلا نيب
Cout<< sum ; رملاا موقيجارخابهميقلاهدوجوملاريغتملا لخادب
} ةياهن سوق جمانربلا
C++
# Hint .
( \n ) : it is mean new line .
( \t ) : it is mean a seven space .
( ; ) : semi colom–use to end the instruction .
( \\) : use to make a comment –hideen.
#write a program to calculate the sum of two numbers
entered by the user .
Solution :
#include <iostream.h> ءاعدتساهبتكملا
هلادلاهيسيئرلاVoid main ( )
سوقهيادب جمانربلا{
زجحتاريغتملاInt x , y , sum ;
راهظاهلمجلاىللا ىلع نيسوقلا نيبهشاشلاCout<<" enter the first number " ;
عضوهميقلاىتلا مدختسملا اهلخدي فوسCin>> x ;
راهظاهلمجلا ىلعهشاشلاCout<< " enter the secandnumber " ;
عضوهميقلاىتلا مدختسملا اهلخدي فوسىفريغتملاCin>> y ;
جتانلا ظفحو نيريغتملا عمجىف ريغتملاتلاثلاSum = x + y ;
راهظاهلمجلانيسوقلا نيبCout<< " the sum = " ;
راهظاهميقلاهظوفحملا ريغتملا لخادCout<< sum ;
} سوقهياهنجمانربلا
To become a good programmer
you have to practice it yourself
Quiz
#Write a program to multiply two numbers entered by
the user .
Eng: Ahmed Manu