Algorithm Flowchart programming language
Begin;
----------- ;----------- ;
End;
|
Start;
---------- ;---------- ;
Stop;
|
{
---------- ;
}
|
1. Every programming language
starts with main( ).
2. Main indicates execution for
a program.
3. With out main program will
not execute.
Main scope contains
statements. They are two types
1.
Declaration
block.
2.
Execution
block.
Declaration block:
The
declaration block contains ,variables declaration every time. The scope
defining first block is declaration block.
The
declaration of the variable cannot takes
place in the execution block.
Execution block
The execution block
containing the statements like input and out put,logical statements, predefind
functions etc,.
Input and
out put statements:
Every programming language will have input and out put statements in order to capture data for input devices and display them in out put devices.
In c language input and out devices are called as functions. This input and out put statements are classified in to two catageries, FORMATTED and UNFORMATTED.
The formatted can capture and display any type of data.The unformatted only for specific type of data.
Input/output
Formatted:
Data types
|
Input
|
Output
|
Int
|
Scanf( )
|
Printf( )
|
Float
|
Scanf( )
|
Printf( )
|
Char
|
Scanf( )
|
Printf( )
|
string
|
Scanf( )
|
Printf( )
|
unf ormatted:
Data type
|
Input
|
output
|
char
|
Getch( )
Getche( )
Getchar( )
|
Putch( )
Putche( )
Putchar( )
|
Int
|
--------
|
---------
|
Float
|
--------
|
---------
|
String
|
Gets( )
|
Puts( )
|
Input statements:
Form1 :
Printf(“user defined statement”);
Ex: printf(“hello”);
Printf(“hai”);
Form2 :
Printf(“user defined statement with format specification”,arg1.arg2…..argn);
Ex: printf(“%d,%d”,1,2);
Printf(“%d%d=%d”,2,3,2+3);
Output statements:
Scanf(“format-specification”,&arg1,&arg2,….&argn);
Ex: scanf(“%d”,&a); //a=1
Header files: