CPL3
CPL3
Pointer: A pointer is a
variable that stores the
memory address of another
variable as its value. A pointer
variable points to a data type
(like int ) of the same type,
and is created with the *
operator.
Command-line arguments:
Command-line arguments are What is the use of # define?
arguments that are indicated The #define creates a macro,
after the name of the which is the association of an
program in the framework's identifier or parameterized
order line, and these identifier with a token string.
arguments are given to your After the macro is defined,
program during program the compiler can substitute
execution. the token string for each
occurrence of the identifier in
the source file.
WAP to sort an array WAP to sum and Avg. of array WAP to check prime no.
int comp(const void* a, const void* b) { float sum = 0.0, average; if (n <= 1) return false;
// If a is smaller, positive value will be returned printf("Enter the number of elements: "); for (int i = 2; i <= n / 2; i++) {
} int arr[n]; }
} return 0; else
return 0;
#include<stdio.h>
int main() {
return 0;
a technique where a function calls itself Keywords in C refer to a set of reserved
directly or indirectly to solve a problem. words with predefined meanings that
} It is a powerful tool for solving problems are used to write programs in the C
that can be broken down into smaller, programming language.
similar subproblems. Recursion is often
used in algorithms for tasks such as advantages and disadvantages of
searching, sorting, and traversing data pointers
structures like trees and graphs.
Dynamic Memory Allocation
Passing array to function (with
Efficient Memory Access
example)
Passing Parameters by Reference
you can pass a structure to a function in
two ways: by value and by reference. Complexity