C Programming Fundamentals

Test your knowledge of C programming concepts including string handling, character functions, pointers, and bitwise operators

5 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

What will be the result of the following expression in C?
x=strcmpi(&&ABC&&,&&abc&&);
printf(&&x=%d&&,x);

  1. x=1
  2. x=0
  3. x=2
  4. x=3
  5. none of these
Question 2 Multiple Choice (Single Answer)

Which of the following character types of functions in C is used to verify whether inputted characters are in uppercase or not?

  1. toupper()
  2. isupper()
  3. tolower()
  4. isdigit()
  5. isalpha()
Question 3 Multiple Choice (Single Answer)

What will be the output of the following C code?
void main()
{
int *ptr=&"&Chennai&"&;
printf(&"&%c&"&,++(ptr++));
}

  1. C
  2. d
  3. e
  4. a
  5. i
Question 4 Multiple Choice (Single Answer)

Which of the following string handling functions in C is used to reverse the characters in a string?

  1. strupr()
  2. strlen()
  3. strrev()
  4. strcpy()
  5. strcat()
Question 5 Multiple Choice (Single Answer)

What will be the value of 'a' in the following C code?
int a=5;
printf(&"&a=%d&"&,a&2);

  1. a=5
  2. a=1
  3. a=2
  4. a=0
  5. a=3