Find Interview Questions for Top Companies
Ques:- What is storage classes?
Right Answer:
Storage classes in C define the scope, visibility, and lifetime of variables. They determine where a variable is stored, how long it lasts, and how it can be accessed. The main storage classes are:

1. **auto**: Default for local variables, limited to the block in which they are defined.
2. **register**: Suggests that the variable be stored in a CPU register for faster access.
3. **static**: Preserves the variable's value between function calls and limits its scope to the file or function.
4. **extern**: Allows a variable to be accessible across multiple files, indicating that it is defined elsewhere.
Comments
Arvind Sharma Oct 28, 2021

Storage classes in C allocate the storage area of a variable that will be retained in the memory. They are stored in the RAM of a system. Apart from the storage space, they determine the scope of a variable. Variables in the C program are stored in a physical location in the random memory, which is mainly the device’s memory and CPU registers.

Arshitha Oct 28, 2021

auto,
extern
static
register

Ques:- What is swapping?
Right Answer:
Swapping is the process of exchanging the values of two variables. In C programming, this is typically done using a temporary variable to hold one value while the other is assigned.
Comments
vedhamalika.R Nov 13, 2021

Swapping two number in C programming language means exchanging the values of two variables.

Ques:- What is shift operator?
Right Answer:
A shift operator is a bitwise operator that shifts the bits of a number to the left or right. The left shift operator (`<<`) moves bits to the left, filling with zeros, effectively multiplying the number by 2 for each shift. The right shift operator (`>>`) moves bits to the right, discarding bits on the right, effectively dividing the number by 2 for each shift.
Ques:- What is relational operator?
Right Answer:
A relational operator is a symbol used to compare two values or expressions, resulting in a boolean value (true or false). Common relational operators include `==` (equal to), `!=` (not equal to), `>` (greater than), `<` (less than), `>=` (greater than or equal to), and `<=` (less than or equal to).
Ques:- What is ascending order programme?
Right Answer:
An ascending order program is a code that arranges a list of numbers or elements from the smallest to the largest. In C, this can be achieved using sorting algorithms like bubble sort, selection sort, or quicksort.
Ques:- What is descending order program?
Right Answer:
A descending order program sorts a list of numbers or elements from the highest to the lowest value. Here’s a simple example in C:

```c
#include <stdio.h>

void sortDescending(int arr[], int n) {
int i, j, temp;
for (i = 0; i < n-1; i++) {
for (j = 0; j < n-i-1; j++) {
if (arr[j] < arr[j+1]) {
temp = arr[j];
arr[j] = arr[j+1];
arr[j+1] = temp;
}
}
}
}

int main() {
int arr[] = {5, 2, 9, 1, 5, 6};
int n = sizeof(arr)/sizeof(arr[0]);

sortDescending(arr, n);

printf("Sorted array in descending order:n");
for (int i = 0
Ques:- What is do while?
Right Answer:
A `do while` loop is a control flow statement in C that executes a block of code at least once and then repeatedly executes the block as long as a specified condition is true. The syntax is:

```c
do {
// code to be executed
} while (condition);
```
Ques:- What is logical operation?
Right Answer:
A logical operation is a process that evaluates boolean expressions and returns a true or false value based on the logical relationship between the operands, typically using operators like AND, OR, and NOT.
Ques:- What is if else statement?
Right Answer:
An if-else statement is a control structure in C programming that allows you to execute a block of code based on a condition. If the condition is true, the code inside the "if" block runs; if it's false, the code inside the "else" block runs.
Ques:- What is meant by c language?
Right Answer:
C is a high-level programming language that is widely used for system programming, developing operating systems, and embedded systems. It provides low-level access to memory and is known for its efficiency and performance.


AmbitionBox Logo

What makes Takluu valuable for interview preparation?

1 Lakh+
Companies
6 Lakh+
Interview Questions
50K+
Job Profiles
20K+
Users