INTRODUCTION TO COMPUTER PROGRAMMING : INTRODUCTION TO COMPUTER PROGRAMMING Nandhini Devi B.E-CSE
COMPUTER PROGRAMMING : COMPUTER PROGRAMMING Computer programming is a form which designed such a way its human readable and also it is understood by a system
Human readable-gained by writing instructions using some comfortable programming language( c )
Translator-translator used for converting the instruction into machine readable form(compiler)
C LANGUAGE : C LANGUAGE High level language
It’s a basic for all other upcoming programming language
Instn->compiler->linker & loader->result
Structure of C-program : Structure of C-program Preprocessor directive
main fn
{
variable declaration
statement;
}
Simple sample program : Simple sample program 1.#include2.main()3.{4. printf(“Hello, world”);5.}
Output:
Hello, world
Variable Declaration : Variable Declaration Variable Declaration
data type variable name;
Or
Data type variable name= assign some values;
e.g.
Int a;
Int a=5;
Sample program 2 : Sample program 2 #include
// include i/p and o/p file//
#include
//include getchar such fns//
Void Main()
{
int a=5;
Printf(“%d”, a);
}
Activity fr u : Activity fr u Write a program tat would add 2 nos
and mail me
To get nos use scanf fn
Syntax is;
Scanf(“%d,%d”,a,b);
Repeative task : Repeative task If I want to print some 100 nos contin
If I need to print hai 100 times
Then there s a concept called as looping where I can make all this using a single statement
For
Do-while
while
Conditional statement : Conditional statement If I need to check conditions such as to find which no is greater comparatively
Then here will be using conditional statement
i.e. If, if-else, switch-case
Logical statement is included if its needed(<,>,<=,>=)
Next tutorial : Next tutorial we will see advance features in c language frnds..
Thank you buddies