Programing Fundamental Lab Practice
Programing Fundamental Lab Practice
int main() {
This line begins the main function, which is the entry point for C++ programs. The
int before main indicates that the function returns an integer value.
return 0;
This line is used to return an integer value (0 in this case) from the main function.
A return value of 0 typically indicates that the program executed successfully.
}
This line marks the end of the main function.
Variable Initialization Variable Declaration
Int A; int A = 10;
Memory
A A
10
Activity one
Display a right-angled triangle pattern of asterisks:
*
**
***
****
Create an inverted right-angled triangle pattern of numbers:
1
12
123
1234
Print a diamond pattern of stars:
*
***
*****
***
*
Generate a pattern of alternating numbers:
10101
01010
10101
Display a hollow square pattern of hash symbols:
#####
# #
# #
# #
#####
Create a pattern of letters:
A
BC
DEF
GHIJ
KLMNO
Print a right-angled triangle of alphabets:
A
AB
ABC
ABCD
ABCDE
2. Create a program that takes two integer inputs from the user
and displays their sum using "cout."
9. Write a program that prompts the user for their name and then
displays a personalized greeting using "cout."
19. Develop a program that displays the current date and time
using "cout."