0% found this document useful (0 votes)
3 views4 pages

C Programming Notes

The document provides an overview of the C programming language, including its history, importance, and basic syntax. It covers key concepts such as data types, operators, input/output management, control statements, functions, storage classes, structures, unions, pointers, and dynamic memory allocation. Additionally, it includes a sample program and important viva questions related to C programming.

Uploaded by

aazimnihal008
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views4 pages

C Programming Notes

The document provides an overview of the C programming language, including its history, importance, and basic syntax. It covers key concepts such as data types, operators, input/output management, control statements, functions, storage classes, structures, unions, pointers, and dynamic memory allocation. Additionally, it includes a sample program and important viva questions related to C programming.

Uploaded by

aazimnihal008
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

C Programming Notes

Module I – Introduction to C Language

1. History of C Language
- C language was developed by Dennis Ritchie in 1972 at Bell Labs.
- C is called a middle-level language.

Importance of C
- Fast and efficient
- Portable language
- Used in system programming

Sample Program
#include <stdio.h>
int main()
{
printf("Hello World");
return 0;
}

2. Character Set, Tokens, Constants, Variables and Data Types

Character Set
- Alphabets
- Digits
- Special symbols

Tokens
- Keywords
- Identifiers
- Constants
- Operators

Data Types
- int
- float
- char
- double

3. Operators in C
Arithmetic Operators
+ - * / %

Relational Operators
== != > < >= <=

Logical Operators
&& || !

Conditional Operator
condition ? expression1 : expression2;

Bitwise Operators
& | ^ ~ << >>

4. Managing Input and Output

scanf() – formatted input


printf() – formatted output
getchar() – read character
putchar() – write character

Decision Making Statements


- if
- if else
- nested if
- else if ladder
- switch

Loops
- while
- do while
- for loop
- nested loop

Jump Statements
- break
- continue

Arrays
One-dimensional array
Two-dimensional array
Multi-dimensional array

Strings
Functions:
strlen()
strcpy()
strcmp()
strcat()

Functions
- Function declaration
- Function definition
- Function call
- Call by value
- Call by reference
- Recursion

Storage Classes
- auto
- register
- static
- extern

Structure and Union


- Structure declaration
- Arrays of structures
- Nested structures
- Union

Pointers
- Pointer declaration
- Pointer initialization
- Pointer arithmetic
- Pointers and arrays
- Pointers and functions

Dynamic Memory Allocation


Functions:
malloc()
calloc()
realloc()
free()
Important Viva Questions
1. What is C language?
2. What are tokens?
3. Difference between structure and union?
4. What is recursion?
5. What is pointer?

You might also like