Fundamental Programming
Assignment no1.
BSCS (Semester 1st ) Due date: 14-11-2025
1. Variable Declaration
1. Declare an integer variable named age.
2. Declare a float variable named height.
3. Declare a double variable named salary.
4. Declare a character variable named grade.
5. Declare a string variable named name.
2. Variable Initialization
1. Declare and initialize an integer variable rollNumber with value 101.
2. Declare and initialize a float variable temperature with value 36.6.
3. Declare and initialize a char variable section with value 'A'.
4. Declare and initialize a string variable city with value "Karachi".
5. Declare and initialize a double variable weight with value 72.5.
3. Data Types
1. Declare one variable of each type: int, float, double, char, and bool.
2. Write a program that prints the size of each basic data type using sizeof().
3. Declare an integer and a float variable and print their sum.
4. Declare a bool variable isPassed and assign true to it, then print it.
5. Declare a string variable country and print “I live in Pakistan.” using that variable.
4. Constants
1. Define a constant PI = 3.14159 and use it to print the area of a circle.
2. Define a constant integer DAYS_IN_WEEK = 7 and print it.
3. Define a constant string SCHOOL_NAME = "ABC School" and display it.
4. Define a constant MAX_MARKS = 100 and print it.
5. Define a constant INTEREST_RATE = 5.5 and print a message showing it.
5.
1. Write a program that prints “Hello, World!” using cout.
2. Print your name and age using cout.
3. Print the sum of two numbers (for example, 5 + 10) using cout.
4. Print the following message using cout:
5. Print a sentence like:
The temperature today is 30.5 degrees Celsius.