BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan Right Header

HOME BZU Mail Box Online Games Radio and TV Cricket All Albums
Go Back   BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan > Institute of Computing > Bachelor of Science in Information Technology > BsIT 1st semester > Object Oriented Programming


Reply
 
Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
  #1  
Old 06-05-2011, 03:45 PM
JuNaiDiQbaL's Avatar
Never Give Up

 
Join Date: Jan 2011
Location: SahiwaL
Age: 31
Posts: 26
Program / Discipline: BSIT
Class Roll Number: 10-26
JuNaiDiQbaL has a spectacular aura aboutJuNaiDiQbaL has a spectacular aura about
Default A Program that makes a Diamond Pattern Stars in the output.

#include<iostream.h>
#include<conio.h>
void main()
{

int a,b,c,i,j,k,n;

clrscr();

cout<<"enter the value of n\n";

cin>>n;

//for the first half of diamond

for(i=n;i>0;i--)
{
for(j=1;j<i;j++)
{
cout<<" ";
}
for(k=j-1;k<n;k++)
{
cout"*";
cout<<" ";
}
cout<<"\n";
}


//for the second half of diamond

for(a=n-1;a<n&&a!=-1;a--)
{
for(b=n;b>a;b--)
{
cout<<" ";
}
for(c=0;c<a;c++)
{
cout<<"*";
cout<<" ";
}
cout<<"\n";
}

getch();
}
Reply With Quote
Reply

Tags
diamond, makes, output, pattern, program, stars


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A Program that prints square pattern stars in the output. JuNaiDiQbaL Object Oriented Programming 0 06-05-2011 03:50 PM
Program to enter a letter and output the next 2 letters bonfire Object Oriented Programming 3 10-03-2011 12:25 PM
Program to enter an integer and output its 15 multiples bonfire Object Oriented Programming 0 01-03-2011 03:13 PM
Program to enter three integers and output the biggest integer using IF bonfire Object Oriented Programming 0 01-03-2011 03:11 PM
Program to enter three integers and output the biggest integer bonfire Object Oriented Programming 0 01-03-2011 03:10 PM

Best view in Firefox
Almuslimeen.info | BZU Multan | Dedicated server hosting
Note: All trademarks and copyrights held by respective owners. We will take action against any copyright violation if it is proved to us.

All times are GMT +5. The time now is 04:00 PM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.