CS310 assignment 2 Solution
PHP code is following
<?php
echo"Please Select one Option\n\n";
echo"1-Draw Right Angle Triangle of asterisk(*)\n";
echo"2-Draw Pyramid of of asterisk(*)\n";
echo"3-Draw Reverse Pyramid of of asterisk(*)\n\n";
$option = true;
while($option == true)
{
echo"Enter Your Option: ";
$temp = fopen("php://stdin","r");
$line = fgets($temp);
if($line == 1)
{
for($i=1; $i <= 6; $i++)
{
for($j = 1; $j <= $i; $j++)
{
echo "* ";
}
echo"\n";
}
}
elseif($line == 2)
{
for($i=1; $i <= 6; $i++)
{
for($j = 6-$i; $j >= 1; $j--)
{
echo " ";
}
for($k = 1; $k <= $i; $k++)
{
echo"* ";
}
echo "\n";
}
}
elseif($line == 3)
{
for($i=6; $i >= 1; $i--)
{
for($j = 1; $j <= 6-$i; $j++)
{
echo " ";
}
for($k = 1; $k <= $i; $k++)
{
echo" *";
}
....
..... get full code in bellow file
Download CS310 full Assignment 2 Solution.docx
Site Discription
Welcome to JalalZoon Website
Search your content here!!!
Type your Comments
Comment Box is loading comments...
Like website using facebook
12th Class Math || Ch 1 Function and Limits || Exercise 1.3 Question no 2
12th Class Math || Ch 1 Function and Limits || Exercise 1.3 Question no 2 12th Class Math || Ch 1 Function and Limits || F.S.C. & I.C.S ...
-
This is Asif Jalal. In this video I'll explain you that in which cercumstansis ibrahim a.s born.It is said that Ibrahim (AS) experien...
-
Hello Students, Welcome I’m here to talk about the nowadays Student of the universities. Motivations behind this speech!!! Our...
-
12th Class Math || Ch 1 Function and Limits || Exercise 1.3 Question no 2 12th Class Math || Ch 1 Function and Limits || F.S.C. & I.C.S ...