DEV Community

Shubham Athawane
Shubham Athawane

Posted on

Write these C/C++ Program before going to Interview.

While-loop

  1. WAP - To check string is Palindrome or not
  2. WAP - To check number is Armstrong or not.
  3. WAP - To check number is perfect or not.
  4. WAP - To check number is prime or not

  1. WAP - To find number Factorial.
  2. WAP - To find number Factorial or not
  3. WAP - To print Fibonacci & and Tribonacci.
  4. WAP - To find prime number between the number rang
  5. WAP - To calculate area of circle, (Square, rectangle and triangle )
  6. WAP - To check Leap year or not.
  7. WAP - To swap to numbers.
  8. WAP - To swap to numbers without using third variable.

Array

  1. WAP - To sort array element in ascending and descending order.
  2. WAP - To insert element at beginning, ending and any position of array.
  3. WAP - To print array element in reverse order.
  4. WAP - To find maximum and minimum element of array (smallest, largest)
  5. WAP - To print 2d array matrix transport matrix.
  6. WAP - To print mirror matrix
  7. WAP - To swap two matrix.

  1. WAP - To print palindrome string
  2. WAP - To convert temperature Celsius to Fahrenheit and vice-versa
  3. WAP - To add two number using pointer.
  4. WAP - To print 5 student records suing structure and union.
  5. WAP - To calculate total and average marks of 5 subjects (struct)
  6. WAP - to calculate tax

    Conditions : if ≤1000 then “No Tax”

    if > 1000 && ≤ 100000 then “10%” tax

    if > 100000 then “25%” tax

  7. WAP - To add every element from array.

  8. WAP - To search array elements with appropriate location


Patterns

  1. Pattern 1
*
* *
* * *
* * * *
* * * * *
Enter fullscreen mode Exit fullscreen mode
  1. Pattern 2.
* * * * * * 
* * * * * * 
* * * * * * 
* * * * * * 

Enter fullscreen mode Exit fullscreen mode
  1. Pattern 3
           *
         *   *
       *   *   *
     *   *   *   *
   *  *    *   *   *
 *   *   *   *   *   *
Enter fullscreen mode Exit fullscreen mode
  1. Pattern 4
1 
2 3
4 5 6
7 8 9 10
11 12 13 14
Enter fullscreen mode Exit fullscreen mode
  1. Pattern 5.
* * * * * * * * *
  * * * * * * *
    * * * * *
      * * *
        *
Enter fullscreen mode Exit fullscreen mode
  1. Pattern 6: half pyramid of alphabets
A
B B
C C C
D D D D
E E E E E
Enter fullscreen mode Exit fullscreen mode

Top comments (0)