## Program for factorial of a number

Factorial of a non-negative integer, is multiplication of all integers smaller than or equal to n. For example factorial of 6 is 6*5*4*3*2*1 which is… Read More »

- How to learn Pattern printing easily?
- Menu-Driven Program for Bank Management System
- Program to duplicate Vowels in String
- Program to parse the Molecules and get the Atoms count
- Difference between for and while loop in C, C++, Java
- Program to find the Encrypted word
- Find number of candidates in the Exam
- Difference between for and do-while loop in C, C++, Java
- Check if the first and last digit of number N is prime and their sum is less than K
- Program to Encrypt a String using ! and @
- Minimum value to be assigned to the elements so that sum becomes greater than initial sum
- Print the season name of the year based on the month number
- What is an Expression and What are the types of Expressions?
- Program to print the Ladder Pattern
- Program to print the Diagonals of a Matrix

Factorial of a non-negative integer, is multiplication of all integers smaller than or equal to n. For example factorial of 6 is 6*5*4*3*2*1 which is… Read More »

LCM (Least Common Multiple) of two numbers is the smallest number which can be divided by both numbers. For example LCM of 15 and 20… Read More »

GCD (Greatest Common Divisor) or HCF (Highest Common Factor) of two numbers is the largest number that divides both of them. For example GCD of… Read More »

Given an array, cyclically rotate the array clockwise by one. Examples: Input: arr[] = {1, 2, 3, 4, 5} Output: arr[] = {5, 1, 2,… Read More »

Tower of Hanoi is a mathematical puzzle where we have three rods and n disks. The objective of the puzzle is to move the entire… Read More »

Given two matrices, the task to multiply them. Matrices can either be square or rectangular. Examples: Input : mat1[][] = {{1, 2}, {3, 4}} mat2[][]… Read More »

Given an array, find the largest element in it. Example: Input : arr[] = {10, 20, 4} Output : 20 Input : arr[] = {20,… Read More »

A year is leap year if the following conditions are satisfied: Year is multiple of 400. Year is multiple of 4 and not multiple of… Read More »

Given two numbers, write a C program to swap the given numbers. Input : x = 10, y = 20; Output : x = 20,… Read More »

Given an array of integers, find sum of its elements. Examples : Input : arr[] = {1, 2, 3} Output : 6 1 + 2… Read More »

Consider the following simple program as an example of runtime polymorphism. The main thing to note about the program is that the derived class’s function… Read More »

Predict the output of following Java program. filter_none edit close play_arrow link brightness_4 code class Test { public static void main (String[] args) { int… Read More »

One of the advantages of C++ over C is Exception Handling. Exceptions are run-time anomalies or abnormal conditions that a program encounters during its execution.… Read More »

When we use final specifier with a method, the method cannot be overridden in any of the inheriting classes. Methods are made final due to… Read More »

In C++, if a class has at least one pure virtual function, then the class becomes abstract. Unlike C++, in Java, a separate keyword abstract… Read More »