model lab 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

1. You are given a number A in Kilometers. Convert this into B: Meters and C: Centi-Metres.

Print whether a string’s length is odd or even without using in-built function
Write a C program to print the following pattern

A
AB
ABC
ABCD
ABCDE

2. Write a C program for finding the largest of three given numbers


Write the c program to find the largest and the smallest of n numbers given by the user using
arrays.
Write a C program to print the following pattern
54321
4321
321
21
1

3. You are given with Principle amount($), Interest Rate(%) and Time (years) in that order. Find
Simple Interest.
Write a program to calculate the sum of n natural numbers
Write a C program to check whether a given password is valid or not. A valid password must satisfy the
following conditions i) Length of the string must be greater than 8 ii) There must be atleast 1 special
character, 1 uppercase alphabet, 1 lower case alphabet and 1 digit

4. Write a program given the edge of the dodecahedron calculate its Volume. Volume is the amount
of the space which the shapes takes up.
Volume = (15 + 7√5)/4 * e3
Write a C program for the below scenario:
A company insures its driver in the following cases
I. If the driver is married or
II. If the driver is unmarried, male & above 30 years of age or
III. If the driver is unmarried, female & above 25 years of age.
Write a C program to find whether two arrays are same using one-dimensional arrays.
5. Write a program to read an uppercase character from standard input and to convert it into its
corresponding lowercase character
Write a C program to print the prime numbers up to n
Write a program to find given an array arr[] of size n. Numbers are from 1 to (n-1) in random order.
The array has only one repetitive element. We need to find the repetitive element.

6. Write a C program to input week number and print week day


Write a C program to print a string in Toggle case
Toggle case Example:
aPpLe
Write a program to print the sum of elements present in odd positions in the array

7. Write a C program to input month number and print number of days in that month.
Write a program to print the following pattern
****
***
**
*
Write a C program to find total number of vowels and consonants in a string using loop and if else.

8. Write a program to convert the given temperature from fahrenheit(F) to celsius(C).

Note:
​ celsius = (5 / 9) * (fahrenheit - 32)
​ Get a and b from the user and find the value of a power b without using pow()
Write a C program to find the second largest and second smallest number in a given array

9. Print the largest and smallest of 3 numbers without using array


Write a program to print whether 2 strings are equal or not without using in-built function
Write a C program to input elements in array and find frequency of each element in array.
10. Write a C program to input the sides of a triangle and check whether the triangle is valid or not.
Note: A triangle is valid if the sum of its two sides is greater than the third side. Means if a, b, c are three
sides of a triangle. Then the triangle is valid if all these three conditions are satisfied:
a+b>c
a+c>b
b+c>a
Given a number n, we need to find the product of all of its unique prime factors
Write a C program to find minimum occurring character in a string using loop.

You might also like