printing multiple figures side by side - Page 2
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19

Thread: printing multiple figures side by side

  1. #16
    Join Date
    May 2017
    Posts
    175

    Re: printing multiple figures side by side

    The problem is that instructors are so strict on material covered only . if I use something new from else where I will get a 0 because the problem said for loop and use Technics u learned in this chapter which are only simple for loop skills for beginners u see ?
    Last edited by david16; June 19th, 2017 at 04:22 PM.

  2. #17
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    5,787

    Re: printing multiple figures side by side

    So have you covered the ? ternary operator?

    You should be learning how to code the c++ way
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++17 Compiler: Microsoft VS2017 (15.4.1)

  3. #18
    Join Date
    May 2017
    Posts
    175

    Re: printing multiple figures side by side

    NO I didnt . I only covered few topic till now . And I will have to use them to solve this problem

  4. #19
    Join Date
    May 2017
    Posts
    175

    Re: printing multiple figures side by side

    hello there its me again . I did update my code a bit . remember I want the figure to be displayed side by side . I made 2 of them by actually replacing the other sides of the triangle which form a rectangle by spaces still having 2 can you help ?? this is my code

    Code:
     #include < iostream >
    using namespace std;
    
    int main ()
    {
      
    	for ( int i = 1 ; i <= 10 ; ++i ) {    
    
          for ( int j = 1 ; j <= 10 ; j++ ) {
              
    		  if ( j <= i ){
                
    			 cout << "*";
              }
    		  
    		  else {
                
    			 cout << " ";
              }
          }
    
          for ( int j = 1 ; j <= 10 ; j++ ) {
             
    		  if ( j >= i ) {
                
    			 cout << "*";
              }
    		  
    		  else {
                
    		 cout << " ";
              }
          }
    
          cout << endl;
    
    }
    	int k , l ;
       
       for (  k = 1 ; k <= 10 ; k++ ) {
    
    	   for ( l = k ; l < 10 ; l++ ) {
    
    			   cout << " ";
    	 
    	   }
    
    	       for ( l = 1 ; l <= k ; l++ ) {
    
    			   cout << "*";
    
    		   }
    	   
    	   cout << endl;
    
       }
      
    	 cout << "\n";
       
       int i , j;
      
       for (  i = 1 ; i <= 10 ; i++ ) {
    
    	   for ( j = 1 ; j < i ; j++ ) {
    
    			   cout << " ";
    	 
    	   }
    
    	      for ( j = i ; j <= 10 ; ++j ) {
       
    		        cout << "*";
    		}
    
    		 cout << endl;
    
       }
    	system ("pause");
       return 0;
    
    }
    thx for ur help

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This a Codeguru.com survey!


On-Demand Webinars (sponsored)