C-Programming

WhatsApp Channel Join Now
Telegram Group Join Now

31. What is the correct way to define a macro in C?

a) macroName(parameter) { macroBody }

b) #define macroName(parameter) macroBody

c) #macro macroName(parameter) { macroBody }

d) macroName(parameter) { #macro macroBody }

View Answer >

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

#include<stdio.h>

int main()

{

   int x = 5;

   int y = 3;

   printf(“%d”, x += 3);

   return 0;

}

a) 5

b) 3

c) 8

d) 15

View Answer >

33. What is the correct way to declare a string in C?

a) string str;

b) char* str;

c) char[] str;

d) char str[];

View Answer >

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

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

#include<stdio.h>

int main()

{

   int x = 5;

   int y = 3;

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

   return 0;

}

a) 3

b) 5

c) 8

d) 2

View Answer >
WhatsApp Channel Join Now
Telegram Group Join Now

Leave a Comment

telegram Join Telegram