Freshers Programming Question (Set – 1)

Hello Friends,

                     Here the some basic question lists in C and C++ programming language , which are most frequently asked questions in an freshers level / experienced interview in software companies in India.

  1. Write a program to Swap two numbers :
    • using third variable
    • without third variable
    • using bit-wise operator 
  2.  Write a program for 
    • Pass By Value
    • Pass By Reference
  3. Recursion Program:
    1. Prime Number
    2. Factorial series
    3. Fibonacci Series
    4. Sum  of Series
    5. Palindrome
  4. A partition of a positive integer n is a sequence of positive integers that sum to n. Write a program to print all non-increasing partitions of n.
    eg.   n=4
    3 1
    2 2
    2 1 1
    1 1 1 1
  5. Print this pattern:
    2 3
    4 5 6 ,

    and         1
         2     2
      3    3    3.

One thought on “Freshers Programming Question (Set – 1)

  1. It’d be nice it “swapping a variable using bit-wise operators” would be forever dropped from standard programming questions. It’s a dumb trick which only applies to a limited number of types and is not necesarily portable. You won’t ever use it either.

    All the other questions seem fine however.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s