2marks Paper3
2marks Paper3
Constants are fixed values that cannot be altered during program execution.
Example:
Example:
putchar('A'); // Outputs: A
Example:
if (x > 0) printf("Positive");
else printf("Negative");
Example:
Example:
7. What is a string?
Example:
Example:
Example:
Example:
---
Example:
#define PI 3.14
const int MAX = 100;
Example:
Example:
char c = getchar();
Example:
Syntax:
goto label;
label: statement;
Example:
int x = 10;
if (x > 0) goto positive;
positive: printf("Positive number");
7. What is a string?
Example:
8. What is a structure in C?
A structure is a user-defined data type that groups related variables of different types.
Syntax:
struct Name {
int id;
char name[20];
};
Example:
struct Name person;
Example:
Example:
Example:
---