DEADLOCK

Create an engaging and educational illustration featuring a computer program interface displaying code snippets in C, along with visual elements representing data structures like arrays and linked lists, in a modern and vibrant color scheme.

C Programming Deadlock Quiz

Welcome to the C Programming Deadlock Quiz! Test your knowledge on various concepts related to C programming, data structures, and algorithms, focusing specifically on handling deadlocks. Whether you are a student looking to gauge your understanding or a professional brushing up on your skills, this quiz is designed for you.

Challenge yourself with questions that cover:

  • Array handling
  • Data structures
  • Function overloading
  • Linked lists
  • Sorting algorithms
15 Questions4 MinutesCreated by CodingMaster27
How to find the length of array in C?
Sizeof(a)
Sizeof(a[0])
Sizeof(a)/sizeof(a[0])
None of these
Which data structure is used to handle recursion in C?
Stack
Queue
Dequeue
Tree
Which of the following creates a list of 3 visible items and multiple selection abled?
New list(false,3)
New list(3,true)
New list(true,3)
New list(3,false)
What will be the output of the following code snippet?
#include <stdio.h>
void solve() {
    int first = 10, second = 20;
    int third = first + second;
    {
        int third = second - first;
        printf("%d ", third);
    }
    printf("%d", third);
}
int main() {
 solve();
 return 0;
}
10 30
30 10
10 20
20 10
What will be the output of the following code snippet?
#include <stdio.h>
void solve() {
    int a = 3;
    int res = a++ + ++a + a++ + ++a;
    printf("%d", res);
}
int main() {
 solve();
 return 0;
}
12
24
20
18
In which of the following languages is function overloading not possible?
C
C++
Java
Python
What will be the output of the following code snippet?
#include <stdio.h>
void solve() {
    int x = 1, y = 2;
    printf(x > y ? "Greater" : x == y ? "Equal" : "Lesser");
}
int main() {
    solve();
 return 0;
}
Greater
Lesser
Equals
None of these
All of these
Greater and equals
How many times "AAKAR" is printed
int main()
{
while(1)
{
printf("AAKAR");
}
return 0;
}
 
1
Compilation error
Infinity loop
Runtime error
What does the following function do for a given linked list with first node as head
void fun1( struct node* head)
{
 if(head==null)
         return;
 fun1(head->next);
 printf("%d", head->data);
}
 
Prints all nodes of linked list
Prints all nodes of linked list in reverse order
Prints alternative nodes of linked list
Prints alternative nodes of linked list in reverse order
consider the following function that takes reference to head of doubly linked list as parameter. Assume that  node of a doubly linked list has previous pointer as perv and next pointer as next
void func(struct node **head_ref)
{
      struct node *temp=null;
      struct node *current =*head_ref;
      while(current!=null)
      {
           temp= current->prev;
           current->prev=current->next;
           current->next=temp;
           current = current->prev;
       }
       if(temp!=null)
          *head_ref=temp->prev;
}
6 <--> 5 <--> 4 <--> 3 <--> 1 <--> 2
5 <--> 4 <--> 3 <--> 2 <--> 1 <-->6
2 <--> 1 <--> 4 <--> 3 <--> 6 <-->5
6 <--> 5 <--> 4 <--> 3 <--> 2 <--> 1
Following is C like pseudo code of a function that takes a number as an argument, and uses a stack S to do processing
void fun(int n)
{
    Stack S;  // Say it creates an empty stack S
    while (n > 0)
    {
      // This line pushes the value of n%2 to stack S
      push(&S, n%2);
 
      n = n/2;
    }
 
    // Run while Stack S is not empty
    while (!isEmpty(&S))
      printf("%d ", pop(&S)); // pop an element from S and print it
}
Prints binary representation of n in reverse order
Prints binary representation of n
Prints value of Logn
Prints value of Logn in reverse order
Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity?
Insertion sort
Quick sort
Heap sort
Merge sort
How 2nd element in an array accessed, based on pointer notation?
*a + 2
*(a+2)
*(*a+2)
&(a+2)
What will the output of the following code snippet?
 
void solve() {
   int a[] = {1, 2, 3, 4, 5};
   int sum = 0;
   for(int I = 0; I < 5; i++) {
       if(i % 2 == 0) {
           sum += *(a + i);
       }
       else {
           sum -= *(a + i);
       }
   }
   cout << sum << endl;
}
2
15
Syntax error
3
What will be the output of the following code snippet?
 
void solve() {
   deque<int> dq;
   for(int I = 1; I <= 5; i++) {
       if(i % 2 == 0) {
           dq.push_back(i);
       }
       else {
           dq.push_front(i);
       }
   }
   for(auto x: dq) {
       cout << x << " ";
   }
   cout << endl;
}
 
 
 
 
 
1 2 3 4 5
5 4 3 2 1
1 3 5 2 4
5 3 1 2 4
{"name":"DEADLOCK", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Welcome to the C Programming Deadlock Quiz! Test your knowledge on various concepts related to C programming, data structures, and algorithms, focusing specifically on handling deadlocks. Whether you are a student looking to gauge your understanding or a professional brushing up on your skills, this quiz is designed for you.Challenge yourself with questions that cover:Array handlingData structuresFunction overloadingLinked listsSorting algorithms","img":"https:/images/course7.png"}
Powered by: Quiz Maker