Professional Documents
Culture Documents
Basic of C Language
Basic of C Language
Basic of C Language
What is 0 and 1
What is Software ?
Application Software Sum.exe
Operating System
• It is a system software
• Example are DOS, Windosxp, Windows Vista, Windows 7,
Windows 8, Solaris, Macintosh, Linux, Ubuntu etc.
• It provides interface between user and machine
• Acts is a manager of the computer system
• It does process management, memory management, File
management etc.
Execution of a program….
Processor Set of
Register
0101010
MU
010101010101010100 1010101
0101010
RAM 0101010
1010101
CU 0101010
1010101
………..
void main()
Sum.i Linker
{
………
………
} Sum.obj
010101010
101010101
010001010
compiler 010101010
101010101
Being Learning c….
Identifiers
A to Z
a to z 1. Data type deceleration
1. Constant instructions
0 to 9 2. Input output instructions
2. Variable 3. Arithmetic's Instructions
({: “/\? 3. Keywords 4. Control instructions
><+=*
&%!
Programs
Objective
• Constant
• Variable
• Keywords
Constant…
• Any information is called constant
Data=Information=Constant
Type of Constant
Secondary
Primary Array
Integer String
Pointer
Real Union
Structure
Character
Enumerator
Integer Constant
• -55, 55, 0
Real Constant
•55.6, 24.5, 3.56, -56.0, 2.0
Character Constant
• ‘a’ ‘z’ ‘5’ ‘ ‘ ‘2’
Note:- Character constant valid only one symbol
•‘-3’ ‘3.5’ ‘saurabh’ That is not character constant
because in this constant
String included two or more symbol.
• Sequence of Characters are called String
• “Saurabh” “Mumbai”
Process Memory
Instructions
Program Consumes
Memory in RAM
a
b
Data c
getch();
}
Program gotoxy()
#include<stdio.h>
#include<conio.h>
main()
{
clrscr();
gotoxy(40,13);
Printf(“Akash”);
getch();
}
Program of printing variable
The format Specifire can be %d (integer), %c (character),
%s (string), %f (float) %lf(double) etc.
#include<stdio.h> #include<stdio.h>
#include<conio.h> #include<conio.h>
main() main()
{ {
int a=5,b=6; int a=5,b=6;
clrscr(); clrscr();
Printf(“a=%d\n”,a); Printf(“sum of %d and
Printf(“b=%d”,b); %d is %d”,a,b,a+b);
getch(); getch();
} }
scanf()
The format Specifier can be %d (integer), %c (character),
%s (string), %f (float) %lf(double) etc.
scanf() function
The scanf() function is used for input. It reads
the input data from the console.
scanf("format specifier", variable address);