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

PF CS-Fall 2020 Write Programs To Generate Output Using Print Statements

The document outlines a practice assignment for a programming course, requiring students to write various print statements to generate specific outputs. Tasks include printing personal information, creating patterns with asterisks, generating multiplication tables, and defining constants for formatted output. The assignment emphasizes the use of constants and structured output in programming.

Uploaded by

areeba tariq
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)
30 views2 pages

PF CS-Fall 2020 Write Programs To Generate Output Using Print Statements

The document outlines a practice assignment for a programming course, requiring students to write various print statements to generate specific outputs. Tasks include printing personal information, creating patterns with asterisks, generating multiplication tables, and defining constants for formatted output. The assignment emphasizes the use of constants and structured output in programming.

Uploaded by

areeba tariq
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

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

You might also like