SlideShare a Scribd company logo
1 of 60
Download to read offline
Basic
C Programming
Language in
Bangla
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
প্রোগ্রোম : ক োন এ টি সমসযো সমোধোননর জনয
ম্পিউিোনরর ভোষোয়(0,1) লিলিত লনর্দনের
সমটিন কেগ্রোম বনি।
প্রোগ্রোমমিং ভোষো :
কেোগ্রোম রচনোর জনয লবলভন্ন (
েব্দ,বর্ দ,অং ,সংন ত) এবং এগুনিো লবনযোনসর
লনয়ম লমলিনয় ততলর রো হয় কেোগ্রোলমং
ভোষো।নেমন: C,C++,Java,Assembly
language etc.
প্রোগ্রোম(P R O G R A M )
ও
প্রোগ্রোমমিং
ভোষো(P R O G R A M M I N G L A N G U A G E )
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
1.Source code and Object code
2.What is Translator?
3.Types of Translator
4.How to Translator
work(assembler,compiler,interpreter)
TOPIC :
TRANSLATOR
(অনুবোদক
প্রোগ্রোম)
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Sourse code & Object Code
SOURCE CODE
উচ্চতর ভোষোয় লিলিত কেোগ্রোমন ই কসোস দ
ক োড (source code) বনি।
OBJECT CODE
কমলেন ভোষোয় লিলিত ক োডন object code
বিো হয়।
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
TRANSLATOR (অনুবোর্ কেোগ্রোম)
কে কেোগ্রোম কসোস দক োড (source code) ক object code এ পলরর্ত
নর,তোন TRANSLATOR(অনুবোর্ কেোগ্রোম) বনি।
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Assembler(অযোসেম্বলোর)
কে অনুবোর্ কেোগ্রোম অযোসেম্বমল ভোষোয় লিলিত কেোগ্রোমন কমলেন ভোষোয় রূপোন্তর
নর,তোন ই Assembler(অযোসেম্বলোর) বনি।
সুলবধো :
 কননমোলন ক োডন কমলেন ভোষোয় পলরর্ত নর।
 কেোগ্রোনম ভূি থো নি Error Message ের্ে দন নর।
 কেোগ্রোনমর ভূি সংনেোধন রো সহজ।
 লডবোল ং এবং কিলটং এর োজ সংনেোধন রো সহজ।
 কমনমোলরনত ম জোয় ো কনয়।
Assembly
language program Assembler
Machine
Language
অসুলবধো :
 কেোগ্রোম লনব দোহ রোর জনয সময় কবলে েনয়োজন হয়।
 িোইিোনরর তুিনোয় (5-25) গুন সময় কবলে কনয়।
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Compiler(কম্পোইলোর) and Interpreter(ইন্টোরসরটোর)
COMPILER( িোইিোর)
সিূর্ দ কেোগ্রোমন এ সোনথ অনুবোর্ নর।
কে সব কেোগ্রোলমং ভোষোন িোইি রো হয় :
--C,C++,object-
c,C#,Pascal,COBOL,ADA,Visual
Basic,Smalltalk etc.
INTERPRETER(ইন্টোরনেিোর)
সিূর্ দ কেোগ্রোমন এ িোইন এ িোইন
নর অনুবোর্ নর।
কেসব কেোগ্রোলমং ভোষোন ইন্টোরনেিোর রো
হয়
: Basic,php,python,Perl,Ruby,javascript
etc.
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
কোসের ধোপেমূহ
COMPILER(কম্পোইলোর) INTERPRETER(ইন্টোরসর
টোর)
Source
code Compiler
List of error
Object code
1st Step :
2nd Step :
Input
Object
code
Output
Source
code Interpreter Output
Input
Total program translate at a time then execute
Line by line translate then
execute
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
কম্পোইলোর এবিং ইন্টোরসরটোসরর মসধয
পোর্ থকয
কম্পোইলোর ইন্টোরসরটোর
 সিূর্ দ কেোগ্রোমন এ সোনথ অনুবোর্ নর।
 কেোগ্রোনমর সব ভূি এ সোনথ ের্ে দন নর ।
 িোইিোর দ্রুত োজ নর।
 এ বোর কেোগ্রোম িোইি রোর পর পরবতী
িোইি রনত হয় নো।
 বড় ধরননর ম্পিউিোনর কবলে বযবহোর হয়।
 এ িোইন এ িোইন
নর অনুবোর্ নর।
 এ িোইন নর ভূি
ের্ে দন নর।
 ধীনর োজ রো।
 েলতটি োনজর পূনবর্
অনুবোর্ রোর েনয়োজন
হয়।
 মোইনরো ম্পিউিোনর
কবলে বযবহোর রো হয়।
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
অযোি লরর্ম(Algorithm)
কে পদ্ধলতনত ক োন এ টি সমসযোন ধোনপ ধোনপ সমোধোন রো
হয়,তোন অযোলগমরদম(Algorithm) বনি ।
কেমন : লতনটি সংিযোর কেো ফি লনর্ দয় রোর অযোি লরর্ম(Algorithm) ।
Step-1 : Start
Step-2 : Read/Input
Step-3 : Summation of Three numbers.
Step-4 : Print/Output
Step-5 : End
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
অযোলগমরদম(Algori
thm) প্লখোর মনয়ম
/ববমিষ্ট এবিং
েুমবধো
লনয়ম/তবলেি :
 সহজনবোধয হনত হনব।
 েনতয টি ধোপ স্পি হনত হনব,েোনত কে ক োন
কেোগ্রোমোর সহনজ বুঝনত পোনর।
 ধোনপ ধোনপ সমসযোর সমোধোন রনত হনব।
 বযোপ ভোনব েনয়ো রোর উপনেো ী হনত হনব।
সুলবধো :
 কেোগ্রোনমর উনযযেয সহনজ বুঝনত পোনর।
 ভূি লনর্ দনয় সোহোনেয নর।
 কেোগ্রোম পলরবতদন ও পলরবধ দনন সোহোেয নর।
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
প্লোচোটথ
(Flowchart)
কে পদ্ধলতনত ক োন কেোগ্রোমন লচত্র বো েলতন র মোধযনম ে োে রো
হয়।তোন কলোচোিদ বনি।
প্লোচো
টথ
 System এ কডিোর
েবোহ েক্ররয়ো রর্,সংর
ক্ষর্ ও
ফিোফি ের্ে দননর
লর্ লচলিত হয়,তোন
System Flowchart
বনি।
 কেোগ্রোম রচনোর
সময় কে Flowchart
ততলর রো
হয়,তোন Program
Flowchart বনি।
System Flowchart
Program
Flowchart
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Basic
Flowchart
symbols and
meaning
রতীক(Symbol) অর্ থ(Meaning)
End , Start
Process
Decision
Flow line
Connector
Input/output
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Special Symbols of Flowchart
Mult-Document
Preparation
Storage of finished
goods
Logical OR
Delay
Manual Operation
Data Stored
Database
Predefined process
Alternate process
Document
Manual input
Material handling
Storage of raw
materials
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
সমসযো : লতনটি সংিযোর কেো ফি লনর্ দয়
রোর কলোচোিদ (Flowchart) লিি।
Start
Input a,b,c
Sum = a+b+c
End
Output sum
Step-1 : Start​
Step-2 : Read/Input​
Step-3 : Summation of Three
numbers.​
Step-4 : Print/Output​
Step-5 : End
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
অযোি লরর্ম(Algorithm) ও
কলোচোিদ(Flowchart) এর মনধয পোথ য
অযোলগমরদম(ALGORITHM) প্লোচোটথ(FLOWCHART)
ধোনপ ধোনপ সমোধোন নর।
বর্ দনো লনভদর।
বুঝনত সময় কবলে িোন ।
কেোগ্রোম েবোনহর লর্ সহনজ বুঝো
েোয় নো।
কেোগ্রোনমর ভূি র্ূর রো টিন।
 সোংন লত লচি বো েতীন ন র মোধযনম সমসযো
সমোধোন রোন কলোচোিদ বনি।
 লচত্র লনভদর।
 বুঝনত তুিনোমূি সময় ম িোন ।
 সহনজ বুঝো েোয়।
 কেোগ্রোনমর ভূি র্ুর রো সহজ।
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
সুনডোন োড (Pseudo code)
সুনডো(Pseudo) লগ্র েব্দ।অথ দছদ্ম বো ৃ ক্রত্রম।
কর্িনত কেোগ্রোলমং ক োড এর মত মনন হনিও এটি ল ন্তু ক োন কেোগ্রোলমং ক োড নয়।এটি হনিো মুিত
ক োড রোর পূনব দএ টি রোফ বো িসড়ো কিক্সি ভোস দন ততলর রোর েক্ররয়ো।
কেমন : লতনটি সংিযোর কেো ফি লনর্ দয় রোর সুনডোন োড লিি।
Input A
Input B
Input C
Total = A+ B + C
Print Total
Stop
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
কেোগ্রোম ততলরর ধোপসমূহ
কেোগ্রোনমর সোহোনেয ক োন সমসযো সমোধোন রনত হনি তগুনিো ধোপ অনুসরন রনত হয়,আর এই
ধোপসমূহন ই কেোগ্রোম ততলরর ধোপ বিো হয়।
েমেযো
মনমদথষ্টকরণ
েমেযো
মবসেষণ
প্রোগ্রোম
মিেোইন
প্রোগ্রোম উন্নয়ন
প্রোগ্রোম
বোস্তবোয়ন
প্রোগ্রোম
রক্ষণোসবক্ষণ
সমসযো লচলিত রর্
সমসযো সিন দ তথয
সংগ্রহ
 ইনপুি আউিপুি
সনোক্ত
 ম্পিউিোনরর কমনমোলর
লনধ দোরর্
অযোি লরর্ম
কলোচোিদ
কেোগ্রোম ক োলডং।
Algorithm,flowchart
,Pseudo code কথন
কেোগ্রোলমং ভোষোয় কেোগ্রোম
লিিনত হনব।
কিলটং
লডবোল ং
র্ীর্ দনময়োর্ী বযবহোর লনক্রিত রর্।
হোডদওয়োর ,সফ্টওয়োর ও ড ু ইনমন্ট
রক্ষর্োনবক্ষর্।
 োে দ োলরতো ভীরভোনব
পে দনবক্ষর্।
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
লডবোল ং(Debugging) and Error
বো েনব্দর অথ দভূি।নেোগ্রোনমর ভূিগুনিোন বো বিো হয়।
আর কেোগ্রোনম ক োন ভূি পোওয়ো ক নি তো সংনেোধন রোন বিো হয় লডবোল ং।
Syntax error
(বযো রর্ ত ভূ ি)
Logical
error(েুক্রক্তসম্মত ভূ ি)
Runtime
error(তথয ত ভূ ি)
Types of Error
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Error : Any Unexpected output is called error.
ক োলডং রনত েো িোন
Editor
Compiler
Debugger
সফ্টওয়োর :
IDE(Integrated Development Environment)
IDE এর নোমসমূহ :
Eclipse
Code::Block (Open source,Cross patform)
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
কিোন ন(Token)
A token is the smallest element of a program that is meaningful to the compiler.
Types of Token
 Keywords : int,float,while
 Identifiers : sum,main
 Constants : 100,555
 Strings : “JAJSoftTech”
 Special Symbols : [] () {}, ; * = #
 Operators : +,-,*,/,%
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Keyword
Keyword হনিো এমন ল ছু সংরলক্ষত েব্দ,েো এ টি লনলর্দি অথ দবহর্ রনব এবং কেোগ্রোনম এ টি
লনলর্দি োে দসিোর্ন রনব।
মে প্রোগ্রোমমিং এ 32 টট Keyword আসে
auto double int struct
break else long switch
case enum register typedef
char extern return union
float short unsigned continue
signed void efault goto
sizeof volatile do if
static while const for
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Keyword বযবহোনরনর লনয়ম
Keyword িননো variable বো চিন র নোম লহনসনব বযবহোর রো হয় নো।
Keyword সমূনহর েলতটি বর্ দ small letterএর হয়।
েলর্ িননো র্ুটি keyword এ সোনথ বযবহোর রনত হয়,তোহনি মোঝিোনন ফো োাঁ স্থোন থো নত হনব।
keyword সমূনহর নোম এ টি এ েব্দ,অথ দোৎ মোনঝ ক োন ফোাঁ ো স্থোন থোন নো।
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Identifier
Identifiers are used as the general terminology for naming of variables, functions and arrays.
Some identifiers are used :
A-Z,a-z,0-9,$,_
Some valid and non-valid identifier example
Valid identifiers Non-valid identifiers
Number1,Int,std_name 1number ,int, std name
Keyword(Reserved word)
Space can’t be used
Digit can not be used
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Constant
Constants are also like normal variables. But, only difference is, their values can not
be modified by the program once they are defined. Constants refer to fixed values.
Types of Constants :
Integer constants – Example: 0, 1, 1218, 12482
Real or Floating point constants – Example: 0.0, 1203.03, 30486.184
Octal & Hexadecimal constants – Example: octal: (013 )8 = (11)10, Hexadecimal: (013)16 = (19)10
Character constants -Example: ‘a’, ‘A’, ‘z’
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
String & Special Symbols
In C, a string is a sequence of characters.
char greeting[6] = {'H', 'e', 'l', 'l', 'o', '0'};
char greeting[] = "Hello";
Special Symbols :The following special symbols are used in C having some special meaning and thus,
cannot be used for some other purpose.[] () {}, ; * = #
Brackets[]: Opening and closing brackets are used as array element reference. These
indicate single and multidimensional subscripts.
Parentheses(): These special symbols are used to indicate function calls and function
parameters.
Braces{}: These opening and ending curly braces marks the start and end of a block of code
containing more than one executable statement.
comma (, ): It is used to separate more than one statements like for separating parameters in
function calls.
semi colon : It is an operator that essentially invokes something called an initialization list.
asterisk (*): It is used to create pointer variable.
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Variable / চলক
কেোগ্রোনম ক োন এ টি নোম লর্নয় েলর্ তোর মনধয data রোিো হয়,তনব ঐ নোমটিন চি বনি।
কেমন : number 1 = 10;
Name = "JAJ SoftTech"
Variable লিিোর লনয়ম :
1.Variable এর নোম বর্ দ(A-Z,a-z).অঙ্ক(0,1....9),আন্ডোরনকোর (_) এবং ডিোর লচি ($)
বযবহোর রো হয়।
Valid Invalid
first_name "JAJ SoftTech"
Id1 JAJSoftTech@
Code1022 #JAJSoftTech
$JAJSoftTech
- -- Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
2.Variable এর নোম লডক্রজি বো অঙ্ক লর্নয় শুরু হনত পোনর নো।
Invalid Valid
1number _number1,
number,
a2b
3.Keyword বো function কভলরনয়বনির নোম লহনসনব বযবহোর রো েোয় নো।
Valid Invalid
Main main
Float float
for
4. Variable এর নোনমর মোনঝ ক োন ফোাঁ ো স্থোন থোন নো।
Invalid Valid
First number first_number
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Operator
C- ভোষোয় োলর্লত এবং কেৌক্রক্ত োজ রোর জনয তগুনিো লবনেষ লচি (+,-*,/) বযবহোর রো
হয়,এনর্রন অপোনরির বনি।
A + B = 7
Operand
Expression
Constand
Operator
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Types of Operator
Arithmetic Operator
Assignment Operator
Relational Operator
Logical Operator
Conditional Operator
Unary Operator
Bitwise operator
Special Operator
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Arithmetic Operator
Operator কোে উদোহোরণ ফলোফল
+ প্ োগ করো X=15+6 21
- মবসয়োগ করো X=15-6 9
* গুণ করো X=15*6 90
/ ভোগ করো X=15/6 2
% ভোগসিষ X=15%6 3
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
গোমণমতক ফরমুলোসক এসেসরিসন
রূপোন্তর :
গোমণমতক এেসরিন েমতুলয মে এেসরিন
X = a2-2ab + b2 X=a*a – 2*a*b + b*b;
Area = √ s(s - a)(s - b)(s - c) Area = sqrt(s*(s-a)*(s-b)*(s-c));
x = Y X ==Y;
Y=AB2+C Y = A*B*B+C;
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Assignment Operator
Operator Example Full meaning
= X = x+5 X=x+5
+= X+=5 X=x+5
-+ X-=5 X=x-5
*= X*=y X=x*y
/= X/=5 X=x/5
%= X%=5 X=x%5
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Relational Operator
Operator Meaning Example Result
== Equal to 5== 2 False
!= Not equal to 5!= 2 True
< Less than 5<2 False
> Greater than 5> 2 True
<= Less than or equal to 5<= 2 False
>= Greater than or equal
to
5>= 2 True
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Logical Operator
Operator Name Example
&& Logical AND A&&B
|| Logical OR A||B
! Logical NOT !a
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Conditional
Operator
A ternary operator pair "?:" is available in c construct
conditional expression of the forms.
Exp1 ? Exp2 : Exp3;
Example :
If(a>b)
X=a;
Else
X=b;
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Unary Operator
Operator Meaning
+ Unary Plus
- Unary minus
++ Increment
-- Decrement
! Logical implement
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
& Addressof operator
Bitwise Operator
Operator Meaning Example
& Binary AND Operator (A & B) = 12, i.e., 0000 1100
| Binary OR Operator (A | B) = 61, i.e., 0011 1101
^ Binary Ex-OR Operator (A ^ B) = 49, i.e., 0011 0001
>> Binary Right Shift Operator A >> 2 = 15 i.e., 0000 1111
<< Binary Left Shift Operator A << 2 = 240 i.e., 1111 0000
~ Binary One's Complement
Operator
(~A ) = ~(60), i.e,. 1100 0011
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
সমসযো : র্ুটি সংিযোর কেো ফি লনর্ দনয়র জনয Algorithm,Flowchart
এবং C programming code লিি।
Algorithhm :
ধোপ-1:শুরু
ধোপ-2:দুটট েিংখো ইনপুট মনই।
ধোপ-3:েিংখযো দুটট প্ োগ কমর।
ধোপ-4:প্ োগফল রদি থন কমর।
ধোপ-5:প্িষ
Flowchart :
Start
Input a,b
Sum = a+b
Output sum
End
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
সমসযো : লতনটি সংিযোর ড় এবং কেো ফি লনর্ দনয়র
জনয Algorithm,Flowchart এবং C programming code লিি।
Algorithhm :
ধোপ-1:শুরু
ধোপ-2:েিংখযো মতনটট ইনপুট মনই।
ধোপ-3:েিংখযো মতনটটর প্ োগফল মনণ থয় কমর।
ধোপ-4:প্ োগফলসক 3 দ্বোরো ভোগ কসর গড় মনণ থয় কমর।
ধোপ-5:প্ োগফল ও গড় রদি থন কমর।
ধোপ-6:প্িষ
Start
Input a,b,c
Sum = a+b+c
Print Sum,Avg
End
Avg= Sum/3
Flowchart :
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
সমসযো : ক্রত্রভূনজর কক্ষত্রফি লনর্ দনয়
জনয Algorithm,Flowchart এবং C programming code লিি।
Algorithhm :
ধোপ-1:শুরু
ধোপ-2:ভূমম ও উচ্চতো ইনপুট মনই।
ধোপ-3:Area = ½*ভূমম * উচ্চতো,েূত্রটট বযবহোর কসর প্ক্ষত্রফল মনণ থয় কমর।
ধোপ-4:প্ক্ষত্রফল রদি থন কমর
ধোপ-5:প্িষ
Start
Input b,h
Area = ½*b*h
Output Area
End
Flowchart :
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
সমসযো : ক্রত্রভূনজর লতন বোহু র তর্র্ দয কর্ওয়ো আনছ,কক্ষত্রফি
লনর্ দনয়র জনয Algorithm,Flowchart এবং C programming code লিি।(Heron's
Formula)
Algorithm : Flowchart :
ধোপ-1:শুরু
ধোপ-2:মতনটট বোহুর বদর্ঘ থয(a,b,c) ইনপুট মনই।
ধোপ-3:অধ থপমরেীমো (s=a+b+c/2) মনণ থয় কমর।
ধোপ-4: Area = √ s(s - a)(s - b)(s - c) েূত্র বযবহোর
কসর প্ক্ষত্রফল মনণ থয় কমর।
ধোপ-5 : প্ক্ষত্রফল রদি থন কমর।
ধোপ-6:প্িষ
Start
Input a,b,c
s= a+b+c/2
Print Area
End
Area = √ s(s - a)(s - b)(s - c)
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
সমসযো : আয়তনক্ষনত্রর কক্ষত্রফি লনর্ দয় রোর
জনয Algorithm,Flowchart এবং C programming code লিি।
Algorithm :
ধোপ-1:শুরু
ধোপ-2:বদর্ঘ থয এবিং রস্থ ইনপুট মনই।
ধোপ-3:Area = বদর্ঘ থয*রস্থ,েূত্র বযবহোর কসর প্ক্ষত্রফল মনণ থয় কমর।
ধোপ-4: প্ক্ষত্রফল রদি থন কমর।
ধোপ-5:প্িষ।
Flowchart:
Start
Input L,W
Area = L*W
Output Area
End
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
সমসযো : বৃনের কক্ষত্রফি লনর্ দয়
রোর Algorithm,Flowchart এবং C programming code লিি।
Algorithm : Flowchart :
ধোপ-1:শুরু
ধোপ-2:বযোেোধ থ(r) ইনপুট মনই।
ধোপ-3: Area = 3.1416*r*r,েূত্র বযবহোর কসর প্ক্ষত্রফল মনণ থয় কমর।
ধোপ-4:প্ক্ষত্রফল রদি থন কমর।
ধোপ-5:প্িষ
Start
Input r
Area = 3.1416*r*r
Output Area
End
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
সমসযো : কসলন্টনগ্রি ককনির তোপমোত্রোন ফোনরনহোইি ককনি ে োে
রোর Algorithm,Flowchart এবং C programming code লিি।
ধোপ-1: শুরু
ধোপ-2: প্েমন্টসগ্রি তোপমোত্রো (c) মনই।
ধোপ-3: F=(c*1.8)+32,েূত্র বমেসয় ফোসরনহোইট প্েসল তোপমোত্রো মনণ থয়
কমর।
ধোপ-4: ফলোফল রদি থন।
ধোপ-5: প্িষ।
Algorithm : Flowchart:
Start
Input c
F=(c*1.8)+32
Output F
End
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
সমসযো : ফোনরনহোইি ককনির তোপমোত্রোন কসলন্টনগ্রি ককনি
ে োে রোর Algorithm,Flowchart এবং C programming code লিি।
ধোপ-1: শুরু
ধোপ-2: ফোসরনহোইট তোপমোত্রো (f) মনই।
ধোপ-3: C=(f-32)/1.8,েূত্র বমেসয় ফোসরনহোইট প্েসল তোপমোত্রো মনণ থয় কমর।
ধোপ-4: ফলোফল রদি থন।
ধোপ-5: প্িষ।
Algorithm : Flowchart :
Start
Input f
C=(f-32)/1.8
Output F
End
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Decision making Statement
Decision making statement is depending on the condition block need to be executed or not
which is decided by condition.
If the condition is "true" statement block will be executed, if condition is "false" then
statement block will not be executed.
There are three types of decision making statement :
 if
 if-else
 switch
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
if -Statement
Basic Syntax :
if(condition)
{
.......
.......
}
Condition
Condition Block
Flowchart :
if condition
is false
if condition is
true
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
else Statement
Condition
Condition Block
Flowchart :
if condition
is false
if condition is
true
else body
Basic Syntax :
if(condition)
{
.......
.......
}
else
{
…........
.........
}
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
if else /else if Statement
Basic Syntax :
if(condition)
{
…......
........
}
else if(condition)
{
….......
..........
}
else if(condition)
{
…........
…......
}
else
{
…...
…...
}
if condition
else if 2
Flowchart :
false
else if
condition 2
else if
condition 1
if body
else if 1
else body
false
false
true
true
true
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Switch Statement
Statement n
Statement 3
Statement 2
Statement 1 Break
Break
Break
Expression
Case 1
Case 1
Case 1
default
Basic Syntax :
switch(expression/variable)
{
case 1:
//statements
break;
case 1:
//statements
break;
case 2:
//statements
break;
.
.
default:
//statements
}
Flowchart :
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
সমসযো : এ টি সংিযো কজোড় নো
লবনজোড় লনর্ দয় রোর Algorithm,Flowchart এবং C programming code লিি।
Algorithm :
ধোপ-1 : শুরু
ধোপ-2 : ইনপুট num.
ধোপ-3 : num%2 ==0
হযো :প্েোড় েিংখযো।
নো : মবসেোড় েিংখযো।
ধোপ-4:প্িষ।
Input num
Num%2
==0
Print Odd Print Even
Start
End
Flowchart :
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
েমেযো : একটট েিংখযো ধনোত্মক
নোমক ঋণোত্মক তো মনণ থয় করোর Algorithm,Flowchart এবিং C programm
ing code মলখ।
Algorithm :
ধোপ-1 : শুরু
ধোপ-2 : ইনপুট num.
ধোপ-3 : num>0
হযো : ধনোত্মক ।
নো : ঋণোত্মক ।
ধোপ-4 : প্িষ।
Input num
Num>0
Print Positive Print negative
Start
End
Flowchart :
Yes No
Click to add text
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
সমসযো : র্ুটি মনধয বৃহেম
সংিযো লনর্ দয় রোর Algorithm,Flowchart এবং C programming code লিি।
Algorithm :
ধোপ-1 : শুরু
ধোপ-2 : ইনপুট a,b ।
ধোপ-3 : a>b
হযো : a বড় ।
নো : b বড় ।
ধোপ-4:প্িষ।
Input a,b
a>b ??
Print a is
largest
Print b is
largest
Start
End
Flowchart :
Yes No
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
েমেযো : মতনটট
েিংখযোর মসধয বৃহত্তম েিংখযো মনণ থয় করোর Algorithm,Flowchart এবিং C programming code মলখ
।
Algorithm :
ধোপ-1 : শুরু
ধোপ-2 : ইনপুট a,b ,c।
ধোপ-3 : a>b এবিং a>c ?
হযো : a বড় ।
নো :পরবতী ধোসপ
োই।
ধোপ-4 : b>a এবিং b>c ?
হযো : b বড়।
নো : c বড়।
ধোপ-5 : প্িষ ।
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Input a,b,c
a>b &&
a>c ??
Print c is
largest
Print a is
largest
Start
End
Yes
No
b>a &&
b>c
??
Print b is
largest
YesNo
Flowchart :
Loops
A loop statement allows us to execute a statement or group of statements multiple times.
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
for loop
while loop
do...while loop
nested loop
Sr.No Loop Type & Description
1 while loop
Repeats a statement or group of statements while a given condition is true. It tests the condition before
executing the loop body.
2 for loop
Executes a sequence of statements multiple times and abbreviates the code that manages the loop
variable.
3
do...while loop
It is more like a while statement, except that it tests the condition at the end of the loop body.
4 nested loops
You can use one or more loops inside any other while, for, or do..while loop.
C programming language provides the following types of loops to handle looping requirements.
initialization;
while(condition)
{
statement(s);
increment/decrement;
}
while loop
Basic Syntax :
Condition
code Block
Flowchart :
if condition
is false
if condition is
true
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
initialization
initialization;
do {
statement(s);
increment/decrement;
} while( condition );
Basic Syntax :
do...while loop
Condition
Code Block
if condition
is false
if condition is
true
Flowchart :
initialization;
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
for loop
Basic Syntax :
for(init; condition; increment)
{
statement(s);
}
Condition
code Block
Flowchart :
if condition
is false
if condition is
true
initialization
increment
for ( init; condition; increment ) {
for ( init; condition; increment ){
statement(s);
}
statement(s);
}
do {
statement(s);
do {
statement(s);
}while( condition );
}while( condition );
while(condition) {
while(condition) {
statement(s);
}
statement(s);
}
nested loop
while loop do...while for loop
Provided by : Jubair Ahmed Junjun
B.Sc in Computer Science & Engineering(CSE)
Basic Syntax :

More Related Content

What's hot

Chapter1- Introduction to Computers and the Internet
Chapter1- Introduction to Computers and the InternetChapter1- Introduction to Computers and the Internet
Chapter1- Introduction to Computers and the Internet
Fatom Ahmad
 
A project on taxi
A  project on taxi A  project on taxi
A project on taxi
549manish
 

What's hot (20)

Why C is Called Structured Programming Language
Why C is Called Structured Programming LanguageWhy C is Called Structured Programming Language
Why C is Called Structured Programming Language
 
Learn C# - C# .NET Tutorial PDF by Industry Expert
Learn C# - C# .NET Tutorial PDF by Industry ExpertLearn C# - C# .NET Tutorial PDF by Industry Expert
Learn C# - C# .NET Tutorial PDF by Industry Expert
 
Understanding Natural Language Processing
Understanding Natural Language ProcessingUnderstanding Natural Language Processing
Understanding Natural Language Processing
 
सूरदास के पद
सूरदास के पदसूरदास के पद
सूरदास के पद
 
Daily Expense Tracker BSc.CSIT Project Nepal
Daily Expense Tracker BSc.CSIT Project NepalDaily Expense Tracker BSc.CSIT Project Nepal
Daily Expense Tracker BSc.CSIT Project Nepal
 
HSC ICT :PROGRAMMING LANGUAGE. All C-Program Solution
HSC ICT :PROGRAMMING LANGUAGE. All C-Program SolutionHSC ICT :PROGRAMMING LANGUAGE. All C-Program Solution
HSC ICT :PROGRAMMING LANGUAGE. All C-Program Solution
 
معرفی اسکرام
معرفی اسکرام معرفی اسکرام
معرفی اسکرام
 
IRJET - College Enquiry Chatbot
IRJET - College Enquiry ChatbotIRJET - College Enquiry Chatbot
IRJET - College Enquiry Chatbot
 
Coal 11 jumps in Assembly Programming
Coal 11 jumps in Assembly ProgrammingCoal 11 jumps in Assembly Programming
Coal 11 jumps in Assembly Programming
 
Jansankhya siksha
Jansankhya sikshaJansankhya siksha
Jansankhya siksha
 
राजभाषा हिंदी के विकास में कंप्यूटर एवं प्रौद्योगिकी का योगदान
राजभाषा हिंदी के विकास में कंप्यूटर एवं प्रौद्योगिकी का योगदानराजभाषा हिंदी के विकास में कंप्यूटर एवं प्रौद्योगिकी का योगदान
राजभाषा हिंदी के विकास में कंप्यूटर एवं प्रौद्योगिकी का योगदान
 
pdf c programming language.pdf
pdf c programming language.pdfpdf c programming language.pdf
pdf c programming language.pdf
 
My Final year project on Android app development
My Final year project on Android app developmentMy Final year project on Android app development
My Final year project on Android app development
 
Visual Studio Code Can Do That: Tips & Tricks
Visual Studio Code Can Do That: Tips & TricksVisual Studio Code Can Do That: Tips & Tricks
Visual Studio Code Can Do That: Tips & Tricks
 
Chapter1- Introduction to Computers and the Internet
Chapter1- Introduction to Computers and the InternetChapter1- Introduction to Computers and the Internet
Chapter1- Introduction to Computers and the Internet
 
ROS2 on WebOS - Brian Shin(LG)
ROS2 on WebOS - Brian Shin(LG)ROS2 on WebOS - Brian Shin(LG)
ROS2 on WebOS - Brian Shin(LG)
 
Website Wireframe Design.pdf
Website Wireframe Design.pdfWebsite Wireframe Design.pdf
Website Wireframe Design.pdf
 
Bus tracking application project report
Bus tracking application project reportBus tracking application project report
Bus tracking application project report
 
Examination Hall Allocation
Examination Hall Allocation Examination Hall Allocation
Examination Hall Allocation
 
A project on taxi
A  project on taxi A  project on taxi
A project on taxi
 

More from Jubair Ahmed Junjun

More from Jubair Ahmed Junjun (20)

Visual studio code keyboard shortcut
Visual studio code keyboard shortcutVisual studio code keyboard shortcut
Visual studio code keyboard shortcut
 
Sublimetext keyboard shortcut
Sublimetext keyboard shortcutSublimetext keyboard shortcut
Sublimetext keyboard shortcut
 
Notepad++ keyboard shortcut
Notepad++ keyboard shortcutNotepad++ keyboard shortcut
Notepad++ keyboard shortcut
 
Netbeans keyboard shortcut
Netbeans keyboard shortcutNetbeans keyboard shortcut
Netbeans keyboard shortcut
 
Microsoft word2016 keyboard shortcut
Microsoft word2016 keyboard shortcutMicrosoft word2016 keyboard shortcut
Microsoft word2016 keyboard shortcut
 
Microsoft word2013 keyboard shortcut
Microsoft word2013 keyboard shortcutMicrosoft word2013 keyboard shortcut
Microsoft word2013 keyboard shortcut
 
Microsoft word 2010 keyboard shortcut
Microsoft word 2010 keyboard shortcutMicrosoft word 2010 keyboard shortcut
Microsoft word 2010 keyboard shortcut
 
Microsoft word 2007
Microsoft word 2007Microsoft word 2007
Microsoft word 2007
 
Shortcuts for git lab web application
Shortcuts for git lab web applicationShortcuts for git lab web application
Shortcuts for git lab web application
 
Excel 2016 keyboard shortcut
Excel 2016 keyboard shortcutExcel 2016 keyboard shortcut
Excel 2016 keyboard shortcut
 
Excel 2013 keyboard shortcut
Excel 2013 keyboard shortcutExcel 2013 keyboard shortcut
Excel 2013 keyboard shortcut
 
Excel 2010 keyboard shortcut
Excel 2010 keyboard shortcutExcel 2010 keyboard shortcut
Excel 2010 keyboard shortcut
 
Excel 2007 keyboard shortcut
Excel 2007 keyboard shortcutExcel 2007 keyboard shortcut
Excel 2007 keyboard shortcut
 
Aobe photoshop cs5 keyboard shortcut
Aobe photoshop cs5 keyboard shortcutAobe photoshop cs5 keyboard shortcut
Aobe photoshop cs5 keyboard shortcut
 
Adobe photoshop cs4 keyboard shortcut
Adobe photoshop cs4 keyboard shortcutAdobe photoshop cs4 keyboard shortcut
Adobe photoshop cs4 keyboard shortcut
 
Adobe photoshop cc keyboard shortcut
Adobe photoshop cc keyboard shortcutAdobe photoshop cc keyboard shortcut
Adobe photoshop cc keyboard shortcut
 
Adobe illustrator cc keyboard shortcut
Adobe illustrator cc keyboard shortcutAdobe illustrator cc keyboard shortcut
Adobe illustrator cc keyboard shortcut
 
Adobe illustrator c55 keyboard shortcut.
Adobe illustrator c55 keyboard shortcut.Adobe illustrator c55 keyboard shortcut.
Adobe illustrator c55 keyboard shortcut.
 
Modulation in telecommunication
Modulation in telecommunicationModulation in telecommunication
Modulation in telecommunication
 
Java script
Java scriptJava script
Java script
 

Basic C programming language in Bangla.

  • 1. Basic C Programming Language in Bangla Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 2. প্রোগ্রোম : ক োন এ টি সমসযো সমোধোননর জনয ম্পিউিোনরর ভোষোয়(0,1) লিলিত লনর্দনের সমটিন কেগ্রোম বনি। প্রোগ্রোমমিং ভোষো : কেোগ্রোম রচনোর জনয লবলভন্ন ( েব্দ,বর্ দ,অং ,সংন ত) এবং এগুনিো লবনযোনসর লনয়ম লমলিনয় ততলর রো হয় কেোগ্রোলমং ভোষো।নেমন: C,C++,Java,Assembly language etc. প্রোগ্রোম(P R O G R A M ) ও প্রোগ্রোমমিং ভোষো(P R O G R A M M I N G L A N G U A G E ) Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 3. 1.Source code and Object code 2.What is Translator? 3.Types of Translator 4.How to Translator work(assembler,compiler,interpreter) TOPIC : TRANSLATOR (অনুবোদক প্রোগ্রোম) Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 4. Sourse code & Object Code SOURCE CODE উচ্চতর ভোষোয় লিলিত কেোগ্রোমন ই কসোস দ ক োড (source code) বনি। OBJECT CODE কমলেন ভোষোয় লিলিত ক োডন object code বিো হয়। Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 5. TRANSLATOR (অনুবোর্ কেোগ্রোম) কে কেোগ্রোম কসোস দক োড (source code) ক object code এ পলরর্ত নর,তোন TRANSLATOR(অনুবোর্ কেোগ্রোম) বনি। Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 6. Assembler(অযোসেম্বলোর) কে অনুবোর্ কেোগ্রোম অযোসেম্বমল ভোষোয় লিলিত কেোগ্রোমন কমলেন ভোষোয় রূপোন্তর নর,তোন ই Assembler(অযোসেম্বলোর) বনি। সুলবধো :  কননমোলন ক োডন কমলেন ভোষোয় পলরর্ত নর।  কেোগ্রোনম ভূি থো নি Error Message ের্ে দন নর।  কেোগ্রোনমর ভূি সংনেোধন রো সহজ।  লডবোল ং এবং কিলটং এর োজ সংনেোধন রো সহজ।  কমনমোলরনত ম জোয় ো কনয়। Assembly language program Assembler Machine Language অসুলবধো :  কেোগ্রোম লনব দোহ রোর জনয সময় কবলে েনয়োজন হয়।  িোইিোনরর তুিনোয় (5-25) গুন সময় কবলে কনয়। Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 7. Compiler(কম্পোইলোর) and Interpreter(ইন্টোরসরটোর) COMPILER( িোইিোর) সিূর্ দ কেোগ্রোমন এ সোনথ অনুবোর্ নর। কে সব কেোগ্রোলমং ভোষোন িোইি রো হয় : --C,C++,object- c,C#,Pascal,COBOL,ADA,Visual Basic,Smalltalk etc. INTERPRETER(ইন্টোরনেিোর) সিূর্ দ কেোগ্রোমন এ িোইন এ িোইন নর অনুবোর্ নর। কেসব কেোগ্রোলমং ভোষোন ইন্টোরনেিোর রো হয় : Basic,php,python,Perl,Ruby,javascript etc. Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 8. কোসের ধোপেমূহ COMPILER(কম্পোইলোর) INTERPRETER(ইন্টোরসর টোর) Source code Compiler List of error Object code 1st Step : 2nd Step : Input Object code Output Source code Interpreter Output Input Total program translate at a time then execute Line by line translate then execute Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 9. কম্পোইলোর এবিং ইন্টোরসরটোসরর মসধয পোর্ থকয কম্পোইলোর ইন্টোরসরটোর  সিূর্ দ কেোগ্রোমন এ সোনথ অনুবোর্ নর।  কেোগ্রোনমর সব ভূি এ সোনথ ের্ে দন নর ।  িোইিোর দ্রুত োজ নর।  এ বোর কেোগ্রোম িোইি রোর পর পরবতী িোইি রনত হয় নো।  বড় ধরননর ম্পিউিোনর কবলে বযবহোর হয়।  এ িোইন এ িোইন নর অনুবোর্ নর।  এ িোইন নর ভূি ের্ে দন নর।  ধীনর োজ রো।  েলতটি োনজর পূনবর্ অনুবোর্ রোর েনয়োজন হয়।  মোইনরো ম্পিউিোনর কবলে বযবহোর রো হয়। Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 10. অযোি লরর্ম(Algorithm) কে পদ্ধলতনত ক োন এ টি সমসযোন ধোনপ ধোনপ সমোধোন রো হয়,তোন অযোলগমরদম(Algorithm) বনি । কেমন : লতনটি সংিযোর কেো ফি লনর্ দয় রোর অযোি লরর্ম(Algorithm) । Step-1 : Start Step-2 : Read/Input Step-3 : Summation of Three numbers. Step-4 : Print/Output Step-5 : End Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 11. অযোলগমরদম(Algori thm) প্লখোর মনয়ম /ববমিষ্ট এবিং েুমবধো লনয়ম/তবলেি :  সহজনবোধয হনত হনব।  েনতয টি ধোপ স্পি হনত হনব,েোনত কে ক োন কেোগ্রোমোর সহনজ বুঝনত পোনর।  ধোনপ ধোনপ সমসযোর সমোধোন রনত হনব।  বযোপ ভোনব েনয়ো রোর উপনেো ী হনত হনব। সুলবধো :  কেোগ্রোনমর উনযযেয সহনজ বুঝনত পোনর।  ভূি লনর্ দনয় সোহোনেয নর।  কেোগ্রোম পলরবতদন ও পলরবধ দনন সোহোেয নর। Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 12. প্লোচোটথ (Flowchart) কে পদ্ধলতনত ক োন কেোগ্রোমন লচত্র বো েলতন র মোধযনম ে োে রো হয়।তোন কলোচোিদ বনি। প্লোচো টথ  System এ কডিোর েবোহ েক্ররয়ো রর্,সংর ক্ষর্ ও ফিোফি ের্ে দননর লর্ লচলিত হয়,তোন System Flowchart বনি।  কেোগ্রোম রচনোর সময় কে Flowchart ততলর রো হয়,তোন Program Flowchart বনি। System Flowchart Program Flowchart Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 13. Basic Flowchart symbols and meaning রতীক(Symbol) অর্ থ(Meaning) End , Start Process Decision Flow line Connector Input/output Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 14. Special Symbols of Flowchart Mult-Document Preparation Storage of finished goods Logical OR Delay Manual Operation Data Stored Database Predefined process Alternate process Document Manual input Material handling Storage of raw materials Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 15. সমসযো : লতনটি সংিযোর কেো ফি লনর্ দয় রোর কলোচোিদ (Flowchart) লিি। Start Input a,b,c Sum = a+b+c End Output sum Step-1 : Start​ Step-2 : Read/Input​ Step-3 : Summation of Three numbers.​ Step-4 : Print/Output​ Step-5 : End Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 16. অযোি লরর্ম(Algorithm) ও কলোচোিদ(Flowchart) এর মনধয পোথ য অযোলগমরদম(ALGORITHM) প্লোচোটথ(FLOWCHART) ধোনপ ধোনপ সমোধোন নর। বর্ দনো লনভদর। বুঝনত সময় কবলে িোন । কেোগ্রোম েবোনহর লর্ সহনজ বুঝো েোয় নো। কেোগ্রোনমর ভূি র্ূর রো টিন।  সোংন লত লচি বো েতীন ন র মোধযনম সমসযো সমোধোন রোন কলোচোিদ বনি।  লচত্র লনভদর।  বুঝনত তুিনোমূি সময় ম িোন ।  সহনজ বুঝো েোয়।  কেোগ্রোনমর ভূি র্ুর রো সহজ। Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 17. সুনডোন োড (Pseudo code) সুনডো(Pseudo) লগ্র েব্দ।অথ দছদ্ম বো ৃ ক্রত্রম। কর্িনত কেোগ্রোলমং ক োড এর মত মনন হনিও এটি ল ন্তু ক োন কেোগ্রোলমং ক োড নয়।এটি হনিো মুিত ক োড রোর পূনব দএ টি রোফ বো িসড়ো কিক্সি ভোস দন ততলর রোর েক্ররয়ো। কেমন : লতনটি সংিযোর কেো ফি লনর্ দয় রোর সুনডোন োড লিি। Input A Input B Input C Total = A+ B + C Print Total Stop Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 18. কেোগ্রোম ততলরর ধোপসমূহ কেোগ্রোনমর সোহোনেয ক োন সমসযো সমোধোন রনত হনি তগুনিো ধোপ অনুসরন রনত হয়,আর এই ধোপসমূহন ই কেোগ্রোম ততলরর ধোপ বিো হয়। েমেযো মনমদথষ্টকরণ েমেযো মবসেষণ প্রোগ্রোম মিেোইন প্রোগ্রোম উন্নয়ন প্রোগ্রোম বোস্তবোয়ন প্রোগ্রোম রক্ষণোসবক্ষণ সমসযো লচলিত রর্ সমসযো সিন দ তথয সংগ্রহ  ইনপুি আউিপুি সনোক্ত  ম্পিউিোনরর কমনমোলর লনধ দোরর্ অযোি লরর্ম কলোচোিদ কেোগ্রোম ক োলডং। Algorithm,flowchart ,Pseudo code কথন কেোগ্রোলমং ভোষোয় কেোগ্রোম লিিনত হনব। কিলটং লডবোল ং র্ীর্ দনময়োর্ী বযবহোর লনক্রিত রর্। হোডদওয়োর ,সফ্টওয়োর ও ড ু ইনমন্ট রক্ষর্োনবক্ষর্।  োে দ োলরতো ভীরভোনব পে দনবক্ষর্। Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 19. লডবোল ং(Debugging) and Error বো েনব্দর অথ দভূি।নেোগ্রোনমর ভূিগুনিোন বো বিো হয়। আর কেোগ্রোনম ক োন ভূি পোওয়ো ক নি তো সংনেোধন রোন বিো হয় লডবোল ং। Syntax error (বযো রর্ ত ভূ ি) Logical error(েুক্রক্তসম্মত ভূ ি) Runtime error(তথয ত ভূ ি) Types of Error Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE) Error : Any Unexpected output is called error.
  • 20. ক োলডং রনত েো িোন Editor Compiler Debugger সফ্টওয়োর : IDE(Integrated Development Environment) IDE এর নোমসমূহ : Eclipse Code::Block (Open source,Cross patform) Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 21. কিোন ন(Token) A token is the smallest element of a program that is meaningful to the compiler. Types of Token  Keywords : int,float,while  Identifiers : sum,main  Constants : 100,555  Strings : “JAJSoftTech”  Special Symbols : [] () {}, ; * = #  Operators : +,-,*,/,% Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 22. Keyword Keyword হনিো এমন ল ছু সংরলক্ষত েব্দ,েো এ টি লনলর্দি অথ দবহর্ রনব এবং কেোগ্রোনম এ টি লনলর্দি োে দসিোর্ন রনব। মে প্রোগ্রোমমিং এ 32 টট Keyword আসে auto double int struct break else long switch case enum register typedef char extern return union float short unsigned continue signed void efault goto sizeof volatile do if static while const for Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 23. Keyword বযবহোনরনর লনয়ম Keyword িননো variable বো চিন র নোম লহনসনব বযবহোর রো হয় নো। Keyword সমূনহর েলতটি বর্ দ small letterএর হয়। েলর্ িননো র্ুটি keyword এ সোনথ বযবহোর রনত হয়,তোহনি মোঝিোনন ফো োাঁ স্থোন থো নত হনব। keyword সমূনহর নোম এ টি এ েব্দ,অথ দোৎ মোনঝ ক োন ফোাঁ ো স্থোন থোন নো। Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 24. Identifier Identifiers are used as the general terminology for naming of variables, functions and arrays. Some identifiers are used : A-Z,a-z,0-9,$,_ Some valid and non-valid identifier example Valid identifiers Non-valid identifiers Number1,Int,std_name 1number ,int, std name Keyword(Reserved word) Space can’t be used Digit can not be used Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 25. Constant Constants are also like normal variables. But, only difference is, their values can not be modified by the program once they are defined. Constants refer to fixed values. Types of Constants : Integer constants – Example: 0, 1, 1218, 12482 Real or Floating point constants – Example: 0.0, 1203.03, 30486.184 Octal & Hexadecimal constants – Example: octal: (013 )8 = (11)10, Hexadecimal: (013)16 = (19)10 Character constants -Example: ‘a’, ‘A’, ‘z’ Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 26. String & Special Symbols In C, a string is a sequence of characters. char greeting[6] = {'H', 'e', 'l', 'l', 'o', '0'}; char greeting[] = "Hello"; Special Symbols :The following special symbols are used in C having some special meaning and thus, cannot be used for some other purpose.[] () {}, ; * = # Brackets[]: Opening and closing brackets are used as array element reference. These indicate single and multidimensional subscripts. Parentheses(): These special symbols are used to indicate function calls and function parameters. Braces{}: These opening and ending curly braces marks the start and end of a block of code containing more than one executable statement. comma (, ): It is used to separate more than one statements like for separating parameters in function calls. semi colon : It is an operator that essentially invokes something called an initialization list. asterisk (*): It is used to create pointer variable. Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 27. Variable / চলক কেোগ্রোনম ক োন এ টি নোম লর্নয় েলর্ তোর মনধয data রোিো হয়,তনব ঐ নোমটিন চি বনি। কেমন : number 1 = 10; Name = "JAJ SoftTech" Variable লিিোর লনয়ম : 1.Variable এর নোম বর্ দ(A-Z,a-z).অঙ্ক(0,1....9),আন্ডোরনকোর (_) এবং ডিোর লচি ($) বযবহোর রো হয়। Valid Invalid first_name "JAJ SoftTech" Id1 JAJSoftTech@ Code1022 #JAJSoftTech $JAJSoftTech - -- Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 28. 2.Variable এর নোম লডক্রজি বো অঙ্ক লর্নয় শুরু হনত পোনর নো। Invalid Valid 1number _number1, number, a2b 3.Keyword বো function কভলরনয়বনির নোম লহনসনব বযবহোর রো েোয় নো। Valid Invalid Main main Float float for 4. Variable এর নোনমর মোনঝ ক োন ফোাঁ ো স্থোন থোন নো। Invalid Valid First number first_number Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 29. Operator C- ভোষোয় োলর্লত এবং কেৌক্রক্ত োজ রোর জনয তগুনিো লবনেষ লচি (+,-*,/) বযবহোর রো হয়,এনর্রন অপোনরির বনি। A + B = 7 Operand Expression Constand Operator Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 30. Types of Operator Arithmetic Operator Assignment Operator Relational Operator Logical Operator Conditional Operator Unary Operator Bitwise operator Special Operator Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 31. Arithmetic Operator Operator কোে উদোহোরণ ফলোফল + প্ োগ করো X=15+6 21 - মবসয়োগ করো X=15-6 9 * গুণ করো X=15*6 90 / ভোগ করো X=15/6 2 % ভোগসিষ X=15%6 3 Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 32. গোমণমতক ফরমুলোসক এসেসরিসন রূপোন্তর : গোমণমতক এেসরিন েমতুলয মে এেসরিন X = a2-2ab + b2 X=a*a – 2*a*b + b*b; Area = √ s(s - a)(s - b)(s - c) Area = sqrt(s*(s-a)*(s-b)*(s-c)); x = Y X ==Y; Y=AB2+C Y = A*B*B+C; Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 33. Assignment Operator Operator Example Full meaning = X = x+5 X=x+5 += X+=5 X=x+5 -+ X-=5 X=x-5 *= X*=y X=x*y /= X/=5 X=x/5 %= X%=5 X=x%5 Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 34. Relational Operator Operator Meaning Example Result == Equal to 5== 2 False != Not equal to 5!= 2 True < Less than 5<2 False > Greater than 5> 2 True <= Less than or equal to 5<= 2 False >= Greater than or equal to 5>= 2 True Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 35. Logical Operator Operator Name Example && Logical AND A&&B || Logical OR A||B ! Logical NOT !a Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 36. Conditional Operator A ternary operator pair "?:" is available in c construct conditional expression of the forms. Exp1 ? Exp2 : Exp3; Example : If(a>b) X=a; Else X=b; Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 37. Unary Operator Operator Meaning + Unary Plus - Unary minus ++ Increment -- Decrement ! Logical implement Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE) & Addressof operator
  • 38. Bitwise Operator Operator Meaning Example & Binary AND Operator (A & B) = 12, i.e., 0000 1100 | Binary OR Operator (A | B) = 61, i.e., 0011 1101 ^ Binary Ex-OR Operator (A ^ B) = 49, i.e., 0011 0001 >> Binary Right Shift Operator A >> 2 = 15 i.e., 0000 1111 << Binary Left Shift Operator A << 2 = 240 i.e., 1111 0000 ~ Binary One's Complement Operator (~A ) = ~(60), i.e,. 1100 0011 Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 39. সমসযো : র্ুটি সংিযোর কেো ফি লনর্ দনয়র জনয Algorithm,Flowchart এবং C programming code লিি। Algorithhm : ধোপ-1:শুরু ধোপ-2:দুটট েিংখো ইনপুট মনই। ধোপ-3:েিংখযো দুটট প্ োগ কমর। ধোপ-4:প্ োগফল রদি থন কমর। ধোপ-5:প্িষ Flowchart : Start Input a,b Sum = a+b Output sum End Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 40. সমসযো : লতনটি সংিযোর ড় এবং কেো ফি লনর্ দনয়র জনয Algorithm,Flowchart এবং C programming code লিি। Algorithhm : ধোপ-1:শুরু ধোপ-2:েিংখযো মতনটট ইনপুট মনই। ধোপ-3:েিংখযো মতনটটর প্ োগফল মনণ থয় কমর। ধোপ-4:প্ োগফলসক 3 দ্বোরো ভোগ কসর গড় মনণ থয় কমর। ধোপ-5:প্ োগফল ও গড় রদি থন কমর। ধোপ-6:প্িষ Start Input a,b,c Sum = a+b+c Print Sum,Avg End Avg= Sum/3 Flowchart : Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 41. সমসযো : ক্রত্রভূনজর কক্ষত্রফি লনর্ দনয় জনয Algorithm,Flowchart এবং C programming code লিি। Algorithhm : ধোপ-1:শুরু ধোপ-2:ভূমম ও উচ্চতো ইনপুট মনই। ধোপ-3:Area = ½*ভূমম * উচ্চতো,েূত্রটট বযবহোর কসর প্ক্ষত্রফল মনণ থয় কমর। ধোপ-4:প্ক্ষত্রফল রদি থন কমর ধোপ-5:প্িষ Start Input b,h Area = ½*b*h Output Area End Flowchart : Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 42. সমসযো : ক্রত্রভূনজর লতন বোহু র তর্র্ দয কর্ওয়ো আনছ,কক্ষত্রফি লনর্ দনয়র জনয Algorithm,Flowchart এবং C programming code লিি।(Heron's Formula) Algorithm : Flowchart : ধোপ-1:শুরু ধোপ-2:মতনটট বোহুর বদর্ঘ থয(a,b,c) ইনপুট মনই। ধোপ-3:অধ থপমরেীমো (s=a+b+c/2) মনণ থয় কমর। ধোপ-4: Area = √ s(s - a)(s - b)(s - c) েূত্র বযবহোর কসর প্ক্ষত্রফল মনণ থয় কমর। ধোপ-5 : প্ক্ষত্রফল রদি থন কমর। ধোপ-6:প্িষ Start Input a,b,c s= a+b+c/2 Print Area End Area = √ s(s - a)(s - b)(s - c) Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 43. সমসযো : আয়তনক্ষনত্রর কক্ষত্রফি লনর্ দয় রোর জনয Algorithm,Flowchart এবং C programming code লিি। Algorithm : ধোপ-1:শুরু ধোপ-2:বদর্ঘ থয এবিং রস্থ ইনপুট মনই। ধোপ-3:Area = বদর্ঘ থয*রস্থ,েূত্র বযবহোর কসর প্ক্ষত্রফল মনণ থয় কমর। ধোপ-4: প্ক্ষত্রফল রদি থন কমর। ধোপ-5:প্িষ। Flowchart: Start Input L,W Area = L*W Output Area End Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 44. সমসযো : বৃনের কক্ষত্রফি লনর্ দয় রোর Algorithm,Flowchart এবং C programming code লিি। Algorithm : Flowchart : ধোপ-1:শুরু ধোপ-2:বযোেোধ থ(r) ইনপুট মনই। ধোপ-3: Area = 3.1416*r*r,েূত্র বযবহোর কসর প্ক্ষত্রফল মনণ থয় কমর। ধোপ-4:প্ক্ষত্রফল রদি থন কমর। ধোপ-5:প্িষ Start Input r Area = 3.1416*r*r Output Area End Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 45. সমসযো : কসলন্টনগ্রি ককনির তোপমোত্রোন ফোনরনহোইি ককনি ে োে রোর Algorithm,Flowchart এবং C programming code লিি। ধোপ-1: শুরু ধোপ-2: প্েমন্টসগ্রি তোপমোত্রো (c) মনই। ধোপ-3: F=(c*1.8)+32,েূত্র বমেসয় ফোসরনহোইট প্েসল তোপমোত্রো মনণ থয় কমর। ধোপ-4: ফলোফল রদি থন। ধোপ-5: প্িষ। Algorithm : Flowchart: Start Input c F=(c*1.8)+32 Output F End Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 46. সমসযো : ফোনরনহোইি ককনির তোপমোত্রোন কসলন্টনগ্রি ককনি ে োে রোর Algorithm,Flowchart এবং C programming code লিি। ধোপ-1: শুরু ধোপ-2: ফোসরনহোইট তোপমোত্রো (f) মনই। ধোপ-3: C=(f-32)/1.8,েূত্র বমেসয় ফোসরনহোইট প্েসল তোপমোত্রো মনণ থয় কমর। ধোপ-4: ফলোফল রদি থন। ধোপ-5: প্িষ। Algorithm : Flowchart : Start Input f C=(f-32)/1.8 Output F End Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 47. Decision making Statement Decision making statement is depending on the condition block need to be executed or not which is decided by condition. If the condition is "true" statement block will be executed, if condition is "false" then statement block will not be executed. There are three types of decision making statement :  if  if-else  switch Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 48. if -Statement Basic Syntax : if(condition) { ....... ....... } Condition Condition Block Flowchart : if condition is false if condition is true Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 49. else Statement Condition Condition Block Flowchart : if condition is false if condition is true else body Basic Syntax : if(condition) { ....... ....... } else { …........ ......... } Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 50. if else /else if Statement Basic Syntax : if(condition) { …...... ........ } else if(condition) { …....... .......... } else if(condition) { …........ …...... } else { …... …... } if condition else if 2 Flowchart : false else if condition 2 else if condition 1 if body else if 1 else body false false true true true Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 51. Switch Statement Statement n Statement 3 Statement 2 Statement 1 Break Break Break Expression Case 1 Case 1 Case 1 default Basic Syntax : switch(expression/variable) { case 1: //statements break; case 1: //statements break; case 2: //statements break; . . default: //statements } Flowchart : Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 52. সমসযো : এ টি সংিযো কজোড় নো লবনজোড় লনর্ দয় রোর Algorithm,Flowchart এবং C programming code লিি। Algorithm : ধোপ-1 : শুরু ধোপ-2 : ইনপুট num. ধোপ-3 : num%2 ==0 হযো :প্েোড় েিংখযো। নো : মবসেোড় েিংখযো। ধোপ-4:প্িষ। Input num Num%2 ==0 Print Odd Print Even Start End Flowchart : Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 53. েমেযো : একটট েিংখযো ধনোত্মক নোমক ঋণোত্মক তো মনণ থয় করোর Algorithm,Flowchart এবিং C programm ing code মলখ। Algorithm : ধোপ-1 : শুরু ধোপ-2 : ইনপুট num. ধোপ-3 : num>0 হযো : ধনোত্মক । নো : ঋণোত্মক । ধোপ-4 : প্িষ। Input num Num>0 Print Positive Print negative Start End Flowchart : Yes No Click to add text Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 54. সমসযো : র্ুটি মনধয বৃহেম সংিযো লনর্ দয় রোর Algorithm,Flowchart এবং C programming code লিি। Algorithm : ধোপ-1 : শুরু ধোপ-2 : ইনপুট a,b । ধোপ-3 : a>b হযো : a বড় । নো : b বড় । ধোপ-4:প্িষ। Input a,b a>b ?? Print a is largest Print b is largest Start End Flowchart : Yes No Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 55. েমেযো : মতনটট েিংখযোর মসধয বৃহত্তম েিংখযো মনণ থয় করোর Algorithm,Flowchart এবিং C programming code মলখ । Algorithm : ধোপ-1 : শুরু ধোপ-2 : ইনপুট a,b ,c। ধোপ-3 : a>b এবিং a>c ? হযো : a বড় । নো :পরবতী ধোসপ োই। ধোপ-4 : b>a এবিং b>c ? হযো : b বড়। নো : c বড়। ধোপ-5 : প্িষ । Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE) Input a,b,c a>b && a>c ?? Print c is largest Print a is largest Start End Yes No b>a && b>c ?? Print b is largest YesNo Flowchart :
  • 56. Loops A loop statement allows us to execute a statement or group of statements multiple times. Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE) for loop while loop do...while loop nested loop Sr.No Loop Type & Description 1 while loop Repeats a statement or group of statements while a given condition is true. It tests the condition before executing the loop body. 2 for loop Executes a sequence of statements multiple times and abbreviates the code that manages the loop variable. 3 do...while loop It is more like a while statement, except that it tests the condition at the end of the loop body. 4 nested loops You can use one or more loops inside any other while, for, or do..while loop. C programming language provides the following types of loops to handle looping requirements.
  • 57. initialization; while(condition) { statement(s); increment/decrement; } while loop Basic Syntax : Condition code Block Flowchart : if condition is false if condition is true Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE) initialization
  • 58. initialization; do { statement(s); increment/decrement; } while( condition ); Basic Syntax : do...while loop Condition Code Block if condition is false if condition is true Flowchart : initialization; Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE)
  • 59. Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE) for loop Basic Syntax : for(init; condition; increment) { statement(s); } Condition code Block Flowchart : if condition is false if condition is true initialization increment
  • 60. for ( init; condition; increment ) { for ( init; condition; increment ){ statement(s); } statement(s); } do { statement(s); do { statement(s); }while( condition ); }while( condition ); while(condition) { while(condition) { statement(s); } statement(s); } nested loop while loop do...while for loop Provided by : Jubair Ahmed Junjun B.Sc in Computer Science & Engineering(CSE) Basic Syntax :