What is a Program?
A program is a set of instructions or commands which are given to the computer to perform a specific task or operations.
In other words,a program is actually logical sequence of various commands.
Basics Constituents of a 'C' Program
There are mainly three basic constituents of a 'C' language Program:
It
is responsible for the execution of various commands of the 'C'
language Program.That's why it's called the driver of the program.
Syntax:
main()
{
{
<statement 1>;
<statement 2>;
<statement 3>;
}
<statement 2>;
<statement 3>;
}
printf()
The full form of printf() is "print in format".
It is an "Output-statement"
It is used to display the values of any type of variable as well as various messages on the output screen.
It is used to display the values of any type of variable as well as various messages on the output screen.
Syntax:
printf(<"Message<Conversion Specification Characters>[Escape Sequence Characters]"> , <Variable>);
scanf()
The full form of scantf() is "scan in format".
It is an "Input-statement"
It is used to input any type of values or data through the keyboard by the user at runtime in any program of the 'C' language.
It is used to input any type of values or data through the keyboard by the user at runtime in any program of the 'C' language.
Syntax:
scanf(<"Conversion Specification Characters"> , &<Variable>);
NOTE: "&" is Ampersand(Address operator).
It is used only in case of integer,long,float,character but not in case of strings.
No comments:
Post a Comment