0% found this document useful (0 votes)
4 views1 page

CP 24 Assignment-1

This document outlines an assignment for the Computer Programming course at Dawood University, detailing seven programming tasks to be completed in C. The tasks include creating an electricity bill calculator, reversing digits of a number, checking for Armstrong numbers, counting characters in a name, printing a character pyramid, implementing a guessing game, and finding magic numbers. The assignment is due on March 17, 2025, and is worth a maximum of 70 points.

Uploaded by

iamhaseeb56
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)
4 views1 page

CP 24 Assignment-1

This document outlines an assignment for the Computer Programming course at Dawood University, detailing seven programming tasks to be completed in C. The tasks include creating an electricity bill calculator, reversing digits of a number, checking for Armstrong numbers, counting characters in a name, printing a character pyramid, implementing a guessing game, and finding magic numbers. The assignment is due on March 17, 2025, and is worth a maximum of 70 points.

Uploaded by

iamhaseeb56
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/ 1

DAWOOD UNIVERSITY OF ENGINEERING & TECHNOLOGY

DEPARTMENT OF ELECTRONIC ENGINEERING

COURSE TITLE & CODE: SEMESTER: ASSESSMENT ACTIVITY:


Computer Programming 2nd semester, 1st year Assignment 1
IT-1503 Batch 2024
LAST DATE OF SUBMISSION: Max Points: 70
17-03-2025
STUDENT NAME: TEACHER: Engr. Dr. Nadia M. Points Obtained:
Ansari
STUDENT ID:

Q1: Electricity Bill Calculator


Write a C program that calculates the electricity bill of your own home for 1 month based on the number of
units consumed, using nested if-else conditions:
Up to 100 units: Rs. 5 per unit
101-300 units: Rs. 7 per unit
301-500 units: Rs. 10 per unit
Above 500 units: Rs. 15 per unit

Q2: Reverse Digits of a Number (While Loop)


Write a C program that takes an integer of your CELL PHONE NUMBER as input and prints its digits in
reverse order using a while loop.
(Example: Input = 03004569277, Output = 77296540030)

Q3: Armstrong Number (For Loop)


Write a C program that checks if a three-digit number is an Armstrong number using a for loop.
(Hint: An Armstrong number is a number where the sum of the cube of each digit equals the number itself.
Example: 153 = 1³ + 5³ + 3³.)

Q4: Counting Digits in a Number (While Loop)


Write a C program that asks the user to enter YOUR FULL NAME and counts how many characters it has
using a while loop.
(Example: Input = NADIAANSARI, Output = 11 DIGITS)

Q5: Character Pyramid Pattern (Nested Loops)


Write a C program to print your name by following pattern using nested loops:
Example: NADIA
N
NA
NAD
NADI
NADIA
NADIA
Q6: Write a C program to implement a “Guess the Student’s Roll number game”.
Example 001, 004,….. (Do-While Loop). Display the number of attempts it takes to guess the correct number.

Q7: Magic Number Finder


Write a C program that finds all numbers between 1 and 1000 where the sum of their digits is equal to 7 using
oops.

You might also like