Introduction C language C language was developed by Dennis Ritchie in 1972 at AT & T’s Bell Labs, New Jersy, USA. C language is inspired from B language which was developed by Ken Thompson. 80% code of UNIX operating system
Queue in Data Structure
QUEUE 1. How many stacks are required to implement a queue? (a) 1 (b) 2 (c) 3 (d) 4 2. How many queues are needed to implement a stack? (a) 1 (b) 2 (c) 3 (d) 4 3. Suppose implementation
Stack in Data Structure
1. Which of the following is an application of Stack data structure? (a) Evaluation of postfix expression (b) Function calls management (c) Balancing of symbols (d) All of the above 2. What data structure would you mostly likely see in
Sorting in Data Structure
1. Select the sorting that always has a time complexity O(n2 ),irrespective of the condition of array. (a) Bubble sort (b) Selection sort (c) Quick sort (d) Merge sort 2. You have to sort a list L consisting of a
Linked List in Data Structure
1. Let P be a singly linked list. Let Q be the pointer to an intermediate node x in the list. What is the worst-case time complexity of the best known algorithm to delete the node x from the list?
Pointers in C
1. #include “stdio.h” void fun(int *ptr) { *ptr = 30; } int main() { int y = 20; fun(&y); printf(“%d”, y); return 0; } (a) 20 (b) 30 (c) Compiler Error (d) Runtime Error 2. int main() { char *ptr
Strings in C
1. main() { char c[] = “SCABHOPAL”; char *p =c; printf(“%s”, p + p[4] – p[3]) ; } (a) PAL (b) HOPAL (c) BHOPAL (d) SCABHOPAL 2. #include “stdio.h” int main() { char str[] = “ILoveYou”; printf(“%s %s %s\n”, &str[5],
Arrays in C
1. #include “stdio.h” int main() { int arr[5]; // Assume that base address of arr is 2000 and size of integer // is 32 bit arr++; printf(“%u”, arr); return 0; } (a) 2002 (b) 2004 (c) 2020 (d) lvalue required
Recursion in C
1. #include “stdio.h” int fun(int n) { if (n == 4) return n; else return 2*fun(n+1); } int main() { printf(“%d “, fun(2)); return 0; } (a) 4 (b) 8 (c) 16 (d) Runtime Error 2. Consider the following recursive
functions in C
1. #include “stdio.h” int main() { int i = 5; printf(“%d %d %d”, i++, i++, i++); return 0; } (a) 7 6 5 (b) 5 6 7 (c) 7 7 7 (d) Compiler Dependent 2. #include “stdio.h” int main() {