C-Programming

WhatsApp Channel Join Now
Telegram Group Join Now

16. What is the correct way to declare a constant in C?

a) const constantName = value;

b) constantName = value;

c) constantName := value;

d) #define constantName value

View Answer >

17. What is the output of the following code snippet?

#include<stdio.h>

int main()

{

   int x = 5;

   int y = 3;

   if (x > y)

   {

       printf(“x is greater”);

   }

   else

   {

       printf(“y is greater”);

   }

   return 0;

}

a) x is greater

b) y is greater

c) x and y are equal

d) None of the above

View Answer >

18. Which of the following is a correct way to declare an array in C?

a) int arr[5];

b) int arr[];

c) int arr{5};

d) int arr[5] = {};

View Answer >

19. What is the output of the following code snippet?

#include<stdio.h>

int main()

{

   int x = 5;

   int y = 3;

   printf(“%d”, x < y);

   return 0;

}

a) 0

b) 1

c) 5

d) 3

View Answer >

20. Which of the following is not a valid function in C standard library?

a) printf

b) scanf

c) main

d) pow

View Answer >

WhatsApp Channel Join Now
Telegram Group Join Now

Leave a Comment

telegram Join Telegram
Join Now Join Now