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

Itp Lab-02

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

Itp Lab-02

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

Introduction to Programming(ID110) 06 - Nov - 2024

LAB - 2
IIIT Raichur Time : 6:00 pm - 7:30 pm

Instructions Total Marks: 100

The problems you have to solve your own.

1. Submit one code file, written in C, with the (.c) extension.


2. The naming convention for the code file is as follows:
MCYYB10XX_Prblmnum.c, where XX is your roll number, and YY is your admission year.
e.g.- MC24B1001.cpp (for a student who got admitted in 2024, has the roll number 01,
and has made the program using C).
3. Make a ZIP file for the submission and submit it in the google classroom
(filename must be your-roll number_labnum).
4. Submissions must be made within lab timings.
5. DO NOT CHEAT.
6.Please note that delaying submission and copying from others can deduct the marks.

Problem - 1 [20 Marks]

Write a program to check whether an alphabet is a vowel or a consonant irrespective of


whether the alphabet is lowercase or uppercase.
Test Data:
G
Sample Output:
The alphabet is a consonant.

Problem - 2 [30 Marks]

Write a program that calculates the average of a set of numbers input by the user. The user
should be able to input as many numbers as desired, and the program should continue until
the user decides to stop.
Sample Output:
Input numbers to calculate the average(should be in floating point value) (enter a non-numeric value
to stop):
Input a number: 3
Input a number: 1
Input a number: 12
Input a number: -12
Input a number: 6
Input a number: a
Average of input numbers: 2.00

Problem - 3 [50 Marks]

Write a program to display Pascal's triangle for given integer n.

Sample Input:
n=5
Sample Output:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1

##### All The Best! #####

You might also like