Beruflich Dokumente
Kultur Dokumente
Najia Manjur
Lecturer
Department of Computer Science & Engineering (CSE)
Military Institute of Science & Technology (MIST)
Mirpur, Dhaka – 1216, Bangladesh
Types of Programming language
Machine Language
Program written in
Machine language
High-level
program
language
Input Compiler/Interpreter Output
(A computer program)
Highly portable
Function
function_name (arg1, ar2 … argn) Heading
{
Statement 1
Statement 2
Compound
return data; Statement
}
Do complex calculations
A flowchart is a diagram that
represents an algorithm
represents the workflow or process,
shows the order of executing the processes.
#include<stdio.h>
main()
{
int number = 100;
float sum = 57.26 + 100.1
printf(“%d”,number);
printf(“%.2f”,sum);
}
CSE 191 - Computer Programming 14
Variable
A variable is a data name used to store a data value.
They can be modified during the program.
All variables must be declared before they can be used.
Declaration of Variables:
It tells the compiler what the variable name is.
It specifies what type of data the variable will hold.
Format :
data_type var_name;
data_type var_name1, var_name2, var_name3, ………….. ;
#include<stdio.h>
main()
{
int number; Type declarations
Assigning value
number = 100;
float sum = 57.26 + 100.1
printf(“%d”,number);
printf(“%.2f”,sum);
}
CSE 191 - Computer Programming 16
Identifiers
Refers to the name of variables, functions, arrays.
C has 32 keywords
Keywords
Code Meaning
\n New Line
\b Back Space
\t Horizontal Tab
\v Vertical Tab
\0 NULL
\” Double quote
\’ Single quote
\\ Backslash
\a Alert
\? Question mark
scanf(“control string”,&variable1,&variable2,
…); format specifier of data being received
scanf(“%d”,&variable);