Results 1 to 8 of 8

Thread: hellp me in c++ problem

  1. #1
    ranaabdullah is offline Senior Member+
    Last Online
    15th September 2019 @ 03:47 PM
    Join Date
    10 Jan 2012
    Age
    33
    Gender
    Male
    Posts
    125
    Threads
    19
    Credits
    1,044
    Thanked
    10

    Default hellp me in c++ problem


    Plese solve this problem.

    Using nested for loop print the following
    *******
    *****
    ***
    *

  2. #2
    ranaabdullah is offline Senior Member+
    Last Online
    15th September 2019 @ 03:47 PM
    Join Date
    10 Jan 2012
    Age
    33
    Gender
    Male
    Posts
    125
    Threads
    19
    Credits
    1,044
    Thanked
    10

    Default

    hellp kro yar kahan gum ho gy it dunya members.

  3. #3
    farimarwat's Avatar
    farimarwat is offline Senior Member+
    Last Online
    28th October 2016 @ 06:03 PM
    Join Date
    09 Nov 2007
    Age
    39
    Posts
    123
    Threads
    20
    Credits
    11
    Thanked: 1

    Default

    int stars = 7;

    for(int i = 0; i < 4; i++){ //Main loop for printing stars in 4 lines
    while(stars > 1){ // this loop will print the whole line
    cout << "* ";
    stars--; //decrement with one
    stars--; // decrement with one or use (stars = stars-2)
    }
    cout << endl; //jump to the next line
    }

  4. #4
    Jk_Niazi is offline Junior Member
    Last Online
    13th April 2013 @ 12:12 PM
    Join Date
    13 Apr 2013
    Location
    Islamabad
    Age
    30
    Gender
    Male
    Posts
    3
    Threads
    0
    Credits
    0
    Thanked: 1

    Default Asterik Design in c++ by Jahanzaib Niazi

    Quote ranaabdullah said: View Post

    Plese solve this problem.

    Using nested for loop print the following
    *******
    *****
    ***
    *

    Here is my Solution!!!Try it in VISUAL STUDIO!!!


    #include "stdafx.h"
    #include<iostream>
    using namespace std;
    void main()
    {
    int i,j;
    for(i=1;i<=7;i++) //Outer loop which is controlling loop
    {
    for(j=i;j<=7;j++) //Inner Loop which is operational loop
    cout<<"*";
    cout<<endl;
    }
    system("pause");
    }

  5. #5
    Join Date
    22 Oct 2009
    Location
    ~*Dream*World*~
    Gender
    Male
    Posts
    21,935
    Threads
    299
    Credits
    1,349
    Thanked
    1701

    Default

    moved from Courses > C++.
    ~* W@R T!ll D3@t|-| *~
    ~* I'll Win Not Immediately But Definitely *~

  6. #6
    khalliqie's Avatar
    khalliqie is offline Senior Member
    Last Online
    22nd May 2018 @ 02:18 PM
    Join Date
    02 Apr 2009
    Location
    Peshawar
    Age
    32
    Gender
    Male
    Posts
    2,493
    Threads
    141
    Credits
    1,230
    Thanked
    162

    Default

    heres solution dear brother

    #include<iostream.h>
    #include<conio.h>
    void main()
    {
    for(int i=7;i>=0;i--)
    {
    for(int j=i;j>=0;j--)
    cout<<"*";
    cout<<endl;
    }
    getch();
    }

    Name:  c++.jpg
Views: 88
Size:  32.5 KB
    [FONT="Comic Sans MS"][CENTER][SIZE="5"][B][COLOR="MediumTurquoise"]"The nicest people tend to often be the ones who have been mistreated the most."[/COLOR][/B][/SIZE][/CENTER][/FONT]

  7. #7
    Join Date
    21 Jan 2010
    Location
    muzaffargarh
    Age
    37
    Gender
    Male
    Posts
    1,072
    Threads
    37
    Credits
    1,373
    Thanked
    37

    Default

    #include <iostream.h>
    #include <conio.h>

    void main()
    {
    int a,b;
    clrscr();

    for(a=7;a>=1;a--)
    {
    for(b=1;b<=a; b++)
    {
    cout << "*";
    }
    cout <<"\n";
    a=a-1; //for removing 2,4 and 6
    }
    getch();
    }

  8. #8
    Faraz abbasii's Avatar
    Faraz abbasii is offline Advance Member
    Last Online
    4th January 2024 @ 01:26 AM
    Join Date
    03 Nov 2009
    Location
    Karachi
    Age
    39
    Gender
    Male
    Posts
    957
    Threads
    96
    Credits
    1,895
    Thanked
    32

    Default

    Quote awarapan85 said: View Post
    heres solution dear brother

    #include<iostream.h>
    #include<conio.h>
    void main()
    {
    for(int i=7;i>=0;i--)
    {
    for(int j=i;j>=0;j--)
    cout<<"*";
    cout<<endl;
    }
    getch();
    }

    Name:  c++.jpg
Views: 88
Size:  32.5 KB
    اس میں ++2 ہوگا

Similar Threads

  1. Ms office word 2003 file problem
    By azizgold9 in forum Ask an Expert
    Replies: 1
    Last Post: 10th March 2016, 09:12 AM
  2. CD Read Problem
    By ALI NOOR in forum Ask an Expert
    Replies: 5
    Last Post: 25th January 2013, 08:53 PM
  3. Problem Hellp!!
    By psp1- in forum Help/Request (PC Games)
    Replies: 5
    Last Post: 12th January 2013, 08:31 PM
  4. Answered Window 7 problim hi problem a to z all it bayon sy guzarish and help
    By ariyanp480782 in forum Solved Problems (IT)
    Replies: 11
    Last Post: 14th October 2012, 12:56 PM

Bookmarks

Posting Permissions

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