C++ programs are frequently asked in the interview. These programs can be asked from basics, array, string, pointer, linked list, file handling etc. Let's see the list of top c++ programs.
Program details
Program details
7) Sum of Digits
Input: a=5 b=10
Output: a=10 b=5
Program details
Input:
Output:
Program details
Input: 9
Output: 1001
Input: 20
Output: 10100
Program details
Output:
Program details
Input: 7
Output:
Home
next
1) fibonacci series
Write a c++ program to print fibonacci series without using recursion and using recursion.
2) Prime number
Write a c++ program to check prime number.
Input: 17
Output: not prime number
Input: 57
Output: prime number
3) Prime number up to N number
Write a program series of prime number up to N number using c++.
Program details
Input: 25
Output: 2 3 5 7 11 13 17 19 23
4) Palindrome number
Write a c++ program to check palindrome number.
5) Factorial
Write a c++ program to print factorial of a number.
Input: 5
Output: 120
Input: 6
Output: 720
6) Armstrong number
Write a c++ program to check armstrong number.
Input: 371
Output: armstrong
Input: 342
Output: not armstrong
Program details
Input: 371
Output: armstrong
Input: 342
Output: not armstrong
Program details
7) Sum of Digits
Write a c++ program to print sum of digits.
Input: 23
Output: 5
Input: 624
Output: 12
Program details
Input: 23
Output: 5
Input: 624
Output: 12
Program details
8) Reverse Number
9) Swap two numbers without using third variable
Write a c++ program to swap two numbers without using third variable.Input: a=5 b=10
Output: a=10 b=5
Program details
10) Matrix Multiplication
Write a c++ program to print multiplication of 2 matrices.Input:
first matrix elements: 1 2 3 1 2 3 1 2 3 second matrix elements 1 1 1 2 1 2 3 2 1
Output:
multiplication of the matrix: 14 9 8 14 9 8 14 9 8
11) Decimal to Binary
Write a c++ program to convert decimal number to binary.Input: 9
Output: 1001
Input: 20
Output: 10100
Program details
12) Alphabet Triangle
Write a c++ program to print alphabet triangle.Output:
A ABA ABCBA ABCDCBA ABCDEDCBA
13) Number Triangle
Write a c++ program to print number triangle.Input: 7
Output:
enter the range= 6
1 121 12321 1234321 123454321 12345654321
No comments:
Post a Comment