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

BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan (http://bzupages.com/)
-   Object Oriented Programming (http://bzupages.com/35-object-oriented-programming/)
-   -   Make stars using C++ loops and if statment (http://bzupages.com/f35/make-stars-using-c-loops-if-statment-633/)

.BZU. 23-08-2008 08:38 PM

Make stars using C++ loops and if statment
 
1 Attachment(s)
Here is the Home work for making start using C++

Attachment 1171
PHP Code:


#include <iostream>
using namespace std;
int counter=1;
int m=1;
int n,j,o;
int main()
{

    for(
n=9;n>=1;n--)
    {
        for (
j=5;j>=counter;j--)
        {
        
cout<<"*";
        }
        


        if(
counter>5)

            {
                for (
o=0;o<=m;o++)

                {
                    
cout<<"*";
        
                }
                
m++;

            }

        
counter++;
        

    
cout<<endl;
    }


return 
0;




All times are GMT +5. The time now is 09:28 PM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.