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

Assignment - Set 1 (12 Marks) - Submit by 15/12/2020 12:00 PM

This document contains instructions for an assignment with 3 questions: 1. Write a program using a for loop to print a series from -10 to n terms, increasing by 10 each time. 2. Write a program using a while loop to display odd numbers between variables X and Y. 3. Write a program using a switch statement to input a letter and number of cars, then increase the cars by a different amount depending on the letter, and display the results.

Uploaded by

saleem raza
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)
11 views2 pages

Assignment - Set 1 (12 Marks) - Submit by 15/12/2020 12:00 PM

This document contains instructions for an assignment with 3 questions: 1. Write a program using a for loop to print a series from -10 to n terms, increasing by 10 each time. 2. Write a program using a while loop to display odd numbers between variables X and Y. 3. Write a program using a switch statement to input a letter and number of cars, then increase the cars by a different amount depending on the letter, and display the results.

Uploaded by

saleem raza
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

Assignment – Set 1 [12 Marks] – Submit by 15/12/2020 12:00 pm

ID : Name: Section :

Note: Answer all the questions.

Question 1: Draw a flow chart and Write a program to print the following series up to n terms by
using for loop. [4]

-10 0 10 20 30 40 50 60 70 ………n terms

Question 2: Write a program to display the odd numbers between X and Y by using while loop. [4]

Question 3: Write a program using switch to input a letter (L) and and number of cars(C). The
program will do the following according the value of L and displays it as shown below. ( 4 marks)

Letter(L) Action
a or A Increase the number of cars by
30 and display

l or L Increase the number of cars by


20 and display

c or C Increase the number of cars by


15 and display

Any other letter Display “Invalid input”

You might also like