PuzzlersWorld.com

  • Hacker Puzzle
  • Interview Puzzles
  • Number Puzzles
  • Maths Puzzles

Objective Questions set C/C++ – Part 5

(2 votes, average: 3.00 out of 5)

October 28, 2012 by asinghal Leave a Comment

4 Objective type interview questions on C/C++ with answers

Before you start:-

  1. You can check your answer by filling a,b,c,d or e in the text box.
  2. You can get the answer by clicking Give Up Button.

Try yourself before giving up 🙂

Q1)

#include
int main(){
    char a[5]="hello";
    printf("%s",a);
}

Options: a) will print “hello” only b) will print some garbage values c) will print “hello” atleast d) None

Tried enough already?

Q2)

#include
int main(){
    char *a="Hello" "India";
    printf("%s",a);
}

Options: a) Hello India b) HelloIndia c) Compilation error d) Run-time error

Tried enough already?
Q3)

#include
int main(){
    int i = 2;
    int z = ++i + i++;
    printf("%d,%d", z, i);
}

Options: a) 5,4 b) 4,4 c) 7,4 d) 6,4 e) 5,3

Tried enough already?

Q4)

#include
main()
{
    int x=5;
    printf("%d %d %d\n",x,x<<2,x>>2);
}

Options: a) 5 20 16 b) 5 1 20 c) 5 10 2 d) 5 20 1 e) 4 4 1

Tried enough already?
  • Share on Whatsapp
  • Share on Facebook
  • Share on Twitter
Facebook Comments
Next Puzzle
Swap two integer variables

Checkout more Interview Questions Tags: C/C++, Interview, Solved Puzzles

Leave a Comment Cancel reply

Submit your Puzzle

You may also like

  • Find Number present only once
  • Permutations solution: Facebook hacker cup 2013 Round 2
  • Manage Your Energey Solution: Google codejam 2013 Round 1A
  • 3 SUM problem
  • implement isPalindrome(int n)
  • Output of the recursive program
  • Dead Pixels solution: Facebook hacker cup 2013 Round 1
  • Objective Questions set C/C++ – Part 4
  • Card Game solution: Facebook hacker cup 2013 Round1
  • Cookie Clicker Alpha Solution – Google Code Jam 2014

Categories

  • Aive hi Puzzles
  • Akbar and Birbal
  • Alphabetical Puzzles
  • Bollywood Puzzles
  • Google Code jam
  • Hindi Riddles
  • Interview Puzzles
  • Interview Questions
  • Logical Puzzles
  • Malayalam Puzzles
  • Maths Puzzles
  • Miscellaneous
  • Number Puzzles
  • Picture Puzzles
  • Riddles
  • Tamil Puzzles
  • Technical

Social

  • View puzzlersworld’s profile on Twitter
privacy policy

Copyright © 2025 · eleven40 Pro Theme on Genesis Framework · WordPress · Log in

  • Hacker Puzzle
  • Logo Puzzles
  • Optical Illusions
  • WhatsApp Puzzles
  • Picture Puzzles
  • Riddles
    â–¼
    • Hindi Riddles
  • Bollywood Puzzles
  • Alphabetical Puzzles
  • Aive hi Puzzles
  • Interview Puzzles
  • Logical Puzzles
  • Interview Questions
    â–²
    • Data Structures
    • Binary Tree
    • Algorithms
    • Recursion Questions
    • Amazon Interview Questions
    • Snapdeal Interview Questions
    • Google Code jam
  • Technical
  • Akbar and Birbal
  • Number Puzzles
  • Maths Puzzles
  • Miscellaneous