// Write a program to print numbers from 1 to 10 using a loop // Write a program to print numbers from 100 down to 1. // Write a program to print the multiplication table of a number entered by the user. // Write a program to print the first 10 even numbers. // Write a program to print the first 10 odd
// Write a program to find the sum of the first n natural numbers. // Write a program to find the sum of all even numbers between 1 and 100 // Write a program to find the sum of all odd numbers between 1 and 100 // Write a program to calculate the sum of squares of the first n natural numbers // Write a program to calculate the sum of cubes of the first n natural numbers
// Write a program to calculate the factorial of a number // Write a program to count the number of digits in a given number. // Write a program to calculate the sum of digits of a number. // Write a program to reverse a number (e.g., 1234 → 4321). // Write a program to check whether a number is a palindrome (e.g., 121 → Palindrome).
// Write a program to check whether a number is prime. // Write a program to print all prime numbers between 1 and 100. // Write a program to generate the first n terms of the Fibonacci series.
// Write a program to print a right-angled triangle of stars ( * ) of height 5. *
// Write a program to print a square pattern of numbers (5 × 5). 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5
// Write a program to find the sum of digits of a number using a loop. // Write a program to check whether a number is an Armstrong number (e.g., 153 = 1³+5³+3³). // Write a program to print all Armstrong numbers between 1 and 500. // Write a program to check whether a number is a perfect number (e.g., 28 = 1+2+4+7+14). // Write a program to print the Fibonacci series up to a given number n. // Write a program to calculate the power of a number (a^b) using loops. // Write a program to find the greatest common divisor (GCD) of two numbers using a loop. // Write a program to find the least common multiple (LCM) of two numbers using a loop. // Write a program to display all prime factors of a number.
// Write a program to print a square of stars (5 × 5).
// Write a program to print a right-angled triangle of numbers. 1 1 2 1 2 3 1 2 3 4 // Write a program to print a pyramid of stars. *
// Write a program to print an inverted pyramid of stars.
// Write a program to print Floyd’s triangle up to n rows. 1 2 3 4 5 6 7 8 9 10
Write a program to print Pascal’s triangle up to n rows. 37. Write a program to print a hollow square of stars.
-
* -
* -
*
// Write a program to print a diamond pattern using stars. // Write a program to print multiplication tables from 1 to 10 in tabular form. // Write a program to print a checkerboard pattern (like a chessboard) using stars. // Write a program to input 5 integers into an array and display them. // Write a program to find the sum of all elements in an array. // Write a program to find the average of elements in an array. // Write a program to find the largest element in an array. // Write a program to find the smallest element in an array.
// Write a program to count how many times a given number occurs in an array. // Write a program to search for an element in an array (Linear Search). // Write a program to find the second largest element in an array. // Write a program to count the number of positive and negative numbers in an array. // Write a program to count the number of even and odd elements in an array. // Write a program to reverse the elements of an array. // Write a program to copy elements of one array into another array. // Write a program to interchange the first and last elements of an array. // Write a program to check if an array is sorted in ascending order. // Write a program to rotate an array to the left by one position. // Write a program to sort an array in ascending order. // Write a program to sort an array in descending order. // Write a program to find the sum of even elements and odd elements separately in an array. // Write a program to merge two arrays into a third array. // Write a program to remove duplicate elements from an array.