0% found this document useful (0 votes)
20 views2 pages

Experi Men 4

This document provides 10 programming problems involving looping concepts in C language. The problems include: 1) Displaying the first n natural numbers and their sum. 2) Displaying the multiplication table for a given integer. 3) Displaying a right angle triangle pattern using asterisks. 4) Finding the greatest common divisor (GCD) of two numbers. 5) Checking if a given number is an Armstrong number. 6) Displaying a pyramid pattern using asterisks. 7) Checking if a given number is prime. 8) Displaying the first n terms of the Fibonacci series. 9) Displaying a pattern with 1 as the first and last number of each row. 10) Finding the lowest common multiple (LCM)

Uploaded by

pradyumnadef
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views2 pages

Experi Men 4

This document provides 10 programming problems involving looping concepts in C language. The problems include: 1) Displaying the first n natural numbers and their sum. 2) Displaying the multiplication table for a given integer. 3) Displaying a right angle triangle pattern using asterisks. 4) Finding the greatest common divisor (GCD) of two numbers. 5) Checking if a given number is an Armstrong number. 6) Displaying a pyramid pattern using asterisks. 7) Checking if a given number is prime. 8) Displaying the first n terms of the Fibonacci series. 9) Displaying a pattern with 1 as the first and last number of each row. 10) Finding the lowest common multiple (LCM)

Uploaded by

pradyumnadef
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Experiment-4: Concept of Looping:

SL.N Experiments
o
1. Write a program in C to display n terms of natural numbers and
their sum.

Expected Output:
The first 10 natural number is :
1 2 3 4 5 6 7 8 9 10
The Sum is : 55
2. Write a program in C to display the multiplication table for a
given integer.
Test Data :
Input the number (Table to be calculated) : 15
Expected Output :
15 X 1 = 15
...
...
15 X 10 = 150
3. Write a program in C to display a pattern like a right angle
triangle using an asterisk.
The pattern like :
*
**
***
****
4. Write a C program to find the Greatest Common Divisor (GCD)
of two numbers.

Example: In a manufacturing company, engineers want to


optimize the packaging process to use the least amount of
material efficiently. They need to find the largest possible size
for packaging boxes that can be used for multiple products. We
want to implement a C program to find the Greatest Common
Divisor (GCD) of two numbers, which will help determine the
optimal size for packaging boxes.
Consider the following dimensions of packaging boxes required
for two products:
Product 1: Length = 120 cm, Width = 60 cm
Product 2: Length = 90 cm, Width = 45 cm
5. Write a C program to check whether a given number is an
Armstrong number or not.
Test Data :
Input a number: 153
Expected Output :
153 is an Armstrong number.
6. Write a C program to make such a pattern as a pyramid with an
asterisk.
*
**
***
****
7. Write a C program to determine whether a given number is
prime or not.
Test Data :
Input a number: 13
Expected Output :
13 is a prime number.
8. Write a program in C to display the first n terms of the Fibonacci
series.
Fibonacci series 0 1 2 3 5 8 13 .....
Test Data :
Input number of terms to display : 10
Expected Output :
Here is the Fibonacci series upto to 10 terms :
0 1 1 2 3 5 8 13 21 34
9. Write a C program to display a such a pattern for n rows using a
number that starts with 1 and each row will have a 1 as the first
and last number.
1
121
12321
10. Write a C program to find the LCM of any two numbers using
HCF.
Test Data :
Input 1st number for LCM: 15
Input 2nd number for LCM: 20
Expected Output :
The LCM of 15 and 20 is : 60

You might also like