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

Name: CH Muhammad Bilal Riaz: Roll No Section C Lab

This document contains 3 coding problems and their solutions. Problem 1 creates a boat shape using printf statements. Problem 2 creates a house shape. Problem 3 creates a tree shape. Each problem includes the source code to print the shapes along with sample output.

Uploaded by

bilal jani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views6 pages

Name: CH Muhammad Bilal Riaz: Roll No Section C Lab

This document contains 3 coding problems and their solutions. Problem 1 creates a boat shape using printf statements. Problem 2 creates a house shape. Problem 3 creates a tree shape. Each problem includes the source code to print the shapes along with sample output.

Uploaded by

bilal jani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

[Type text]

Name:
Ch Muhammad Bilal Riaz

(Electrical Engineering)

Roll No 012
Section C
Lab 01
[Type text]

Problem 1
Statement: Creat file (boat c)
Source Code:
#include<stdio.h>
int main()
{
printf(" __\n");
printf(" /||\n");
printf(" / ||\n");
printf(" / ||\n");
printf(" / ||\n");
printf(" / ||\n");
printf(" / ||\n");
printf(" / ||\n");
printf(" /_______||\n");
printf(" ||\n");
printf(" ||\n");
printf(" ______________________________||_____________\n");
printf(" \\ /\n");
printf(" \\ /\n");
printf(" \\ /\n");
printf(" \\_____________________________________/\n");
return 0;
}

Output:
[Type text]

Problem 2
Statement: Create File (house.c)
Source code:
#include<stdio.h>
int main()
{
printf(" _____________________________________ \n ");
printf(" /\\ \\ \n");
printf(" / \\ \\ \n");
printf(" / \\ _________ \\ \n");
printf(" / \\ \\ \\ \\ \\\n");
printf(" / \\ \\===\\=== \\ \\ \n");
printf(" / \\ \\___\\____\\ \\ \n");
printf(" / \\ \\ \n");
printf(" / \\ \\ \n");
printf(" /________________\\ \\ \n");
printf(" /| |\\____________________________________\\ \n");
printf(" | | |\n");
printf(" | | | \n");
printf(" | | |\n");
printf(" | ________ | ___ | \n");
printf(" | | | | |_|_| | \n");
printf(" | | | | |_|_| | \n");
printf(" | | | | | \n");
printf(" | | '| | | \n");
printf(" | | | | |\n");
printf(" |____|______|____|____________________________________| \n");
return 0;
}
[Type text]

Output:
[Type text]

Problem 3

Statement: Create File (tree.c)


Source code:
#include<stdio.h>
int main()
{
printf(" /\\ \n");
printf(" //\\\\\ \n");
printf(" ///\\\\\\\ \n");
printf(" ////\\\\\\\\ \n");
printf(" /////\\\\\\\\\\ \n");
printf(" //////\\\\\\\\\\\\ \n");
printf(" ///////\\\\\\\\\\\\\\ \n");
printf(" ////////\\\\\\\\\\\\\\\\ \n");
printf(" /////////\\\\\\\\\\\\\\\\\\ \n");
printf(" //////////\\\\\\\\\\\\\\\\\\\\ \n");
printf(" ///////////\\\\\\\\\\\\\\\\\\\\\\ \n");
printf(" ///////////||\\\\\\\\\\\\\\\\\\\\\\\ \n");
printf(" || \n");
printf(" || \n");
printf(" || \n");
printf(" || \n");
printf(" || \n");
printf(" || \n");
printf(" || \n");
return 0;
}

Output:
[Type text]

You might also like