Completed Math Practical
Completed Math Practical
Title page…………………………...................................i
Declaration..........................................................................ii
Recommendations..............................................................iii
Endorsement......................................................................iv
Acknowledgement..............................................................v
Table Of Contents..............................................................vi
CHAPTER I: INTRODUCTION
Introduction Of C programming............................................1
1
Chapter 1:
Introduction
3. Control Flow:
1
C provides control flow statements like if, else, while, for, and switch for decision-making and
looping.
if (age >= 18) {
printf("You are eligible to vote.\n");
} else { printf("You are not eligible to vote.\n"); }
4. Functions:
Functions in C allow you to modularize your code. They can be declared and defined as follows:
// Function declaration int add(int a, int b); // Function definition int add(int a, int b) { return a +
b; }
5. Pointers:
C supports pointers, which are variables that store memory addresses. They provide powerful
mechanisms for memory manipulation.
int num = 10;
int *ptr = #
// Pointer to the address of num printf("Value at the address pointed by ptr: %d\n", *ptr);
6. Arrays:
Arrays allow you to store multiple values of the same type in a contiguous memory block.
int numbers[5] = {1, 2, 3, 4, 5};
7. Structures:
Structures enable you to group variables of different data types under a single name.
struct Person { char name[50]; int age; };
These are just the basics; C programming has many more features and concepts to explore. It's
often used in system programming, embedded systems, and other performance-critical
applications due to its efficiency and close-to-the-hardware capabilities. Learning C is a great
foundation for understanding programming concepts and languages.
2
Program Codes
3
Conclusion
4
BIBLOGRAPHY