PF CS-Fall 2020
Practice 01 (Dated: 14-02-2020)
Write programs to generate output using print statements:
a. Print your first name here
Print your house no, street & block
Print your city
b. *
**
***
****
_____ _____
c. |_____| >>-----------------> |_____|
d. ----->
----->
----->
----->
e. ----->
------->
--------->
------->
----->
f. 2 x 1 = 2
2 x 2 = 4
2 x 3 = 6
2 x 4 = 8
2 x 5 = 10
2 x 6 = 12
2 x 7 = 14
2 x 8 = 16
2 x 9 = 18
2 x 10 = 20
g. 1*
2**
3***
4****
5*****
h. *****
* *
* *
* *
******
*
*
*
Complete to write PA KISTAN
Resource Person: Abdul Mateen September 16, 2019
PF CS-Fall 2020
Define constants and use them in multiple print statements , first of all see exam ple:
#define M "This is a dummy message \n"
int main(){
printf(M);
printf(M);
return 0;
}
i. Define constant to represent horizontal line using hyphen sign and use co nstant to
generate o utput:
--------------------
| W E L C O M E |
--------------------
j. Define constant s to represent your name & address. Generate following output having
your name and address on top & bottom :
Your Name
Your Address
Programming is fun.
I like Programming.
Programming needs practice and I am ready to do practice .
Your Name
Your Address
Resource Person: Abdul Mateen September 16, 2019