Tagged: basics

Largest Amongst Three Numbers

“Largest Amongst Three Numbers” is very basic programming Exercise problem. Here, we are given three numbers, entered by user and our task is to write a program to find the largest amongst three number. Example (Largest Amongst Three Numbers): INPUT: Num1 = 10 Num2 = 20 Num3 = 30 OUTPUT...

Find Quotient and Remainder

“Find Quotient and Remainder” is very basic programming exercise for beginners. Here, we are given divisor and dividend and our task is to write a program to find quotient and remainder. Quotient = dividend / divisor Remainder = dividend % divisor Example (find quotient and remainder): INPUT: Dividend = 10, Divisor =...

Compute Power of a Number

“Compute Power of a Number” is again basic problem of programming for beginners. Here, we are given a base and exponent number, entered by users and our task is to write a program to compute the power of a number, baseexponent. 23 = 2 * 2 * 2 = 8 Example...

blank

Compute Nth Fibonacci Number

“Compute Nth Fibonacci Number” is similar to problem of printing fibonacci series upto Nth Term, the only difference between is that, in this problem we need to compute and print only Nth Term of the Fibonacci Series, while, in other problem we need to print the fibonacci series up to...

blank

Print Fibonacci Series up to Nth Term

“Print Fibonacci Series up to Nth Term” is one of the most popular problem of programming. Here, we are given a number ‘n’, entered by user and our task is to print the Fibonacci series up to nth Term. Fibonacci Series: 0, 1, 1, 2, 3, 5, 8,… The first...

blank

Swap Two Numbers

“Swap Two Numbers” is a basic programming exercise for beginners. Here, we are given two numbers, entered by user and our task is to write a program to swap these numbers. Example (swap two numbers): Before Swapping:  A = 10, B = 20 After Swapping A = 20, B =...

blank

Reverse a Number

“Reverse a Number” is a very basic programming exercise problem for beginners. Here, we are given a number, entered by user and our task is to write a program to reverse a number. Example: INPUT: Num = 45 OUTPUT: Num = 54 The steps required to reverse a number are...

blank

Sum of First n Natural Numbers

“Sum of First n Natural Numbers” is a basic programming exercise problem for beginners. Here, we are given a number ‘n’ and our task is to compute the sum of first ‘n’ natural numbers. Natural Numbers: 1,2,3,……… Example (Sum of first n Natural Numbers): INPUT: N = 5 OUTPUT: 15...