Programskkkmk
Programskkkmk
Preprocessor Directives
##
7. Combining Tokens Using
##operator in
rite a program that demonstrates token pasting using the
W
macros.
#if
11.Conditional Compilation with #else
, #endif
, and
#if
rite a program that uses
W #else
, #endiftocontrol which parts
, and
of the code are compiled based on a defined constant.
14. #error
Custom Error Messages with
#errorto generate custom errormessages
emonstrate the use of
D
during compilation.
15. __DATE__and
Predefined Macros like __TIME__
__DATE__and
Write a program that prints the current date and time using
__TIME__
.
16. #elif
Conditional Macro Expansion Using
#if
se
U #elif
, #endifto demonstrate conditionalmacro
, and
expansion for multiple cases.
oal: Implement the Bubble Sort algorithm to sort an array of integers in
G
ascending order.
escription: In each pass, adjacent elements are compared, and if they are
D
in the wrong order, they are swapped. The process repeats until the entire
array is sorted.
oal: Implement the Selection Sort algorithm to sort an array of integers in
G
descending order.
oal: Implement the Quick Sort algorithm to sort an array of integers using
G
a recursive approach.
oal: Implement the Merge Sort algorithm to sort an array of integers using
G
recursion.
Basic Programs:
. Dynamic memory allocation for an integer:
1
Allocate memory for an integer using malloc and free it after storing and
printing a value.
Basic Programs:
. Factorial of a number:Calculate the factorialof a given number using
1
recursion.
Intermediate Programs:
11. Towers of Hanoi:Solve the Towers of Hanoi problemusing recursion.
Basic Programs:
. Basic enum declaration and usage:Define an enumfor days of the
1
week and print a specific day using the enum.
Intermediate Programs:
. Enum for compass directions:Create an enum forthe four compass
6
directions (North, East, South, West) and use it in a program that controls
the movement of an object in a 2D plane.
. Enum for card suits in a card game:Create an enumfor the four suits
9
in a deck of cards (Hearts, Diamonds, Clubs, Spades) and write a program
that uses this enum to simulate drawing cards.
Focus: Pattern matching, bad character rule, and good suffix rule.
1D Arrays
1. Find Element at a Specific Index:Write a programto retrieve the
element at a specific index in a 1D array.
6. Sum and Average of Array Elements:Calculate the sumand average of
all elements in a 1D array.
2D Arrays
11. Matrix Addition:Write a program to add two 2Darrays (matrices).
Basic Programs
Intermediate Programs
Advanced Programs
Basic Programs
Intermediate Programs
Advanced Programs
Expert Programs
INGREDREIER ICYNADAI