×
A DAY WITHOUT LEARNING IS A DAY WASTED
--Your friends at LectureNotes
Close

Note for C Language - C By Aman Kumar

  • C Language - C
  • Note
  • 13 Views
  • 1 Offline Downloads
  • Uploaded 10 months ago
Aman Kumar
Aman Kumar
0 User(s)
Download PDFOrder Printed Copy

Share it with your friends

Leave your Comments

Text from page-3

the value 0. Print Function : The C library function int printf() sends formatted output to stdout. Declaration Following is the declaration for printf() function. int printf(); Comments in C language: In programming, comments are used to described the workintg of the code. compiler ignore the line which are written in a comment. There are two types of comment in 'C'1.Single line Comment: // this is used for to declare single line comment. 2.Multi line Comment: /*This type of comment is used to declare multiple line of comment*/ Class 2: Introduction to C block of statement: C has three types of statement1. Assignment ( = ) 2. Selection (Branching): • if(expression) • else • switch 3. Iteration (Looping)

Text from page-4

• While • for • do Blocks: These statement are grouped in to blocks, a blocks is identified by curly brackets. there are two types od Blocks: 1. Statement blocks: if(i==j) { printf("|n martin \n"); } 2.Function Blocks: int add(int a,int b) { int c; c=a+b; return c; } Displaying Data: Displaying data means graph representation of any program:

Text from page-5

Flowchart Symbols For most flowcharts, these five basic symbols are all you will need. Class 3: Data Type: C has a concept of 'data types' which are used to define a variable before its use. The definition of a variable will assign storage for the variable and define the type of data that will be held in the location. The value of a variable can be changed any time. C has the following basic built-in datatypes. int : Following table gives you details about standard integer types with its storage sizes and value ranges: Type Storage size Value range char 1 byte -128 to 127 or 0 to 255 unsigned char 1 byte 0 to 255

Text from page-6

signed char 1 byte -128 to 127 int 2,147,483,648 2,147,483,647 2 or 4 bytes unsigned int 4,294,967,295 2 or 4 bytes 0 to 65,535 or 0 to short 2 bytes -32,768 to 32,767 unsigned short 2 bytes 0 to 65,535 4 bytes -2,147,483,648 to 4 bytes 0 to 4,294,967,295 long 2,147,483,647 unsigned long -32,768 to 32,767 or to float Following table gives you details about standard floating-point types with storage sizes and value ranges and their precision: Type Storage size Value range Precision float places 4 byte 1.2E-38 to 3.4E+38 6 decimal double places 8 byte 2.3E-308 to 1.7E+308 15 decimal 3.4E-4932 to 1.1E+4932 19 decimal long double 10 byte places double : 8 byte char: 1 byte Displaying different data typesa: int - data type

Lecture Notes