VOOZH about

URL: https://www.geeksforgeeks.org/quizzes/c-quiz-108-gq/

⇱ Quiz about C Quiz - 108


Last Updated :
Discuss
Comments

Question 1

Anyone of the followings can be used to declare a node for a singly linked list. If we use the first declaration, “struct node * nodePtr;” would be used to declare pointer to a node. If we use the second declaration, “NODEPTR nodePtr;” can be used to declare pointer to a node.
  • TRUE
  • FALSE

Question 2

Anyone of the following can be used to declare a node for a singly linked list and “NODEPTR nodePtr;” can be used to declare pointer to a node using any of the following
  • TRUE
  • FALSE

Question 3

In a C file (say sourcefile1.c), an array is defined as follows. Here, we don’t need to mention array arr size explicitly in [] because the size would be determined by the number of elements used in the initialization. In another C file (say sourcefile2.c), the same array is declared for usage as follows: In sourcefile2.c, we can use sizeof() on arr to find out the actual size of arr.
  • TRUE
  • FALSE

Question 4

In the below statement, ptr1 and ptr2 are uninitialized pointers to int i.e. they are pointing to some random address that may or may not be valid address.
  • TRUE
  • FALSE

Question 5

Both of the following declarations for function pointers are equivalent. Second one (i.e. with typedef) looks cleaner.
  • TRUE
  • FALSE

Question 6

Choose the correct option to fill the ?1 and ?2 so that the program prints an input string in reverse order. Assume that the input string is terminated by a new line character.

#include <stdio.h>
void wrt_it (void);
int main (void)
{
printf("Enter Text");
printf ("\n");
wrt_ it();
printf ("\n");
return 0;
}
void wrt_it (void)
{
int c;
if (?1)
wrt_it();
?2
}
  • ?1 is  getchar() ! = '\n' ?2 is  getchar(c);

  • ?1 is  (c = getchar()); ! = '\n' ?2 is  getchar(c);

  • ?1 is  c! = '\n' ?2 is  putchar(c);

  • ?1 is (c = getchar()) ! = '\n' ?2 is putchar(c);

Tags:

There are 6 questions to complete.

Take a part in the ongoing discussion