C-Programming

WhatsApp Channel Join Now
Telegram Group Join Now

36. What is the correct way to declare a pointer in C?

a) int* ptr;

b) ptr int;

c) *ptr int;

d) int ptr;

View Answer >

37. 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 >

38. 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 less”);

   }

   else if (x > y)

   {

       printf(“x is greater”);

   }

   else

   {

       printf(“x and y are equal”);

   }

   return 0;

}

a) x is less

b) x is greater

c) x and y are equal

d) None of the above

View Answer >

39. 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) 3

b) 5

c) 8

d) 2

View Answer >

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

#include<stdio.h>

int main()

{

   int x = 5;

   int y = 3;

   printf(“%d”, sizeof(float));

   return 0;

}

a) 2

b) 4

c) 8

d) 1

View Answer >

WhatsApp Channel Join Now
Telegram Group Join Now

Leave a Comment

telegram Join Telegram
Join Now Join Now