Download presentation
Presentation is loading. Please wait.
Published byPoppy Dickerson Modified over 9 years ago
1
GUJARAT KNOWLEDGE VILLAGE Faculty Name:- Prof H.M.Patel Students Name:- SONI VISHAL 130750109111 THAKKER BHAVIN 130750109112 ZALA JAYDIP 130750109124 ZALA JAYDIP 130750109125 Subject:-CPU Branch:-EE
2
ALU CPU CU
3
Every ‘C’ PROGRAM HAS TO FOLLOW SPECIFIC STRUCTURE.. ‘C’ program must have at least one function called as main(). o The main() function has control over the other part of the program.
4
Documentation Header files Constants and Global variables Void main() { Statement(s) } User defined functions and procedures with their body
5
TYPE SIZE RANGE OF VAL char 1 Bytes -128 to +127 int 2 Bytes -32768 to +32767 float 4 Bytes 3.4e-38 to 3.4e+38 double 8 Bytes 1.7e-308 to 1.7e+308
6
1.) Numeric constants 2.) Non Numeric constants
7
It is a number type of constants. It can be Integer constant or real constant. Integer constant can be positive and negative number. This is a valid number. 15 -345 0 +7463
8
These are the constants which is represent other than number. They are two types..... 1.) Character constants 2.) String constants Character constants are single character and are enclosed in single quotes. ‘c’ ‘?’ ‘5’
9
Arithmetic operators Relational operators Logical operators Assignment operators Increment and Decrement operators Conditional operators Bitwise operators Other special operators
10
Arithmetic operators are used to perform arithmetic operations. OPERATORS NAME MEANING + Add - Subtract * Multiply % Divide
11
Relational operators are used to compare variables or constants.. OPERATOR NAME MEANING == Equals != Not equal to > Greater than < Less than
12
operator name meaning && Logical AND II Logical OR ! Logical NOT
13
operator name meaning a= a + 5; a +=5; a= a -5; a -=5; a= a *5; a *=5; a= a /5; a /=5; a= a %5; a %=5;
14
++ increment operators -- decrement operators If a is a variable,, then ++a is called prefix increment. If ‘a’ is a variable,, then a++ is called postfix increment.
15
The files includes at the beginning of ‘C’ program and having an extension.h are called as header files. stdio.h standard input output functions. conio.h console input output functions. string.h string processing functions. math.h mathematical functions ctype.h character type checking functions.
16
If the operands are of different type, then the operand with a lower type is upgraded to the higher type and then the operation is performed. * / % first priority + - second priority
17
When user need the type conversion explicitly, then type casting is used. Remember that type conversion is automatic while type casting is explicitly specific by the programmer in the program. The type casting can be specified in followed form. ( type name ) expression;
18
THANK YOU
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.