Govt. Exams
Entrance Exams
Identifiers cannot start with a digit. They must start with a letter (a-z, A-Z) or underscore.
The size of 'int' is implementation-defined and depends on the compiler and platform, though it is typically 4 bytes on 32-bit systems.
The escape sequence \n represents a newline character that moves the cursor to the next line.
The main() function implicitly returns int type, which indicates the program's exit status (0 for success, non-zero for failure).
Variable names in C must start with a letter or underscore, followed by alphanumeric characters or underscores. '_variable123' is valid, while '2variable' starts with digit, 'var-iable' has hyphen, and 'var iable' has space.
The 'char' data type in C occupies 1 byte of memory and can store a single character.
In C, a pointer to an integer is declared using 'int *ptr;' where '*' indicates pointer declaration.
#include
int main() {
char c = 'A';
printf("%d", c);
return 0;
}
The %d format specifier prints the ASCII value of the character. 'A' has ASCII value 65.
#include
int main() {
char str[] = "Hello";
printf("%c", str[1]);
return 0;
}
String indexing starts at 0. str[0] = 'H', str[1] = 'e'.
A pointer stores the memory address of a variable. Pointer size depends on the system architecture, not always 4 bytes.