473,466 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how i repeat enter number of rows agin after output

4 New Member
#include <stdio.h>

int main()

{

int rows, a, b, space;

printf("Enter number of rows:");
scanf("%d", &rows);

space = rows - 1;
for ( b = 1 ; b <= rows ; b++ )
{
for ( a = 1 ; a <= space ; a++ )
printf(" ");
space--;
for ( a = 1 ; a <= 2*b-1 ; a++)
printf("#");
printf("\n");
}


space = 1;
for ( b = 1 ; b <= rows - 1 ; b++ )
{
for ( a = 1 ; a <= space; a++)
printf(" ");
space++;
for ( a = 1 ; a <= 2*(rows-b)-1 ; a++ )
printf("#");
printf("\n");
}

{
printf("enter number of rows");

}
return 0;
}
Oct 21 '14 #1
5 1291
sharat412
4 New Member
i want repeat of question after output of one is given..
if i enter 5 as input..5 rows are generated...after that i want a code to ask again enter the num of rows untill i close the o/p window...guys plzz help me its my interview question
Oct 21 '14 #2
sharat412
4 New Member
no one here to ans?????????
Oct 21 '14 #3
iam_clint
1,208 Recognized Expert Top Contributor
What you are wanting is a loop.
Oct 21 '14 #4
sharat412
4 New Member
thanking you ...but send me code plzzz
Oct 21 '14 #5
iam_clint
1,208 Recognized Expert Top Contributor
I will not give you the answer it's easy enough I gave you what you needed to run a Google search. If this is for an interview I hate to tell you but you are not qualified for the job.
Oct 21 '14 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Marcel Akkerman | last post by:
Hi, Does anyone have a clue how to reduce the number of nodes using XSLT? When outputing all nodes in order I could just use <xsl:for-each select="name"> But what if I, besides sorting and...
0
by: Phil Lamey | last post by:
I am trying to build a datagrid that would have a header repeat every 10 rows. I don't want a scrollable datagrid because I want the list to be printable. I posted this yesterday and didn't get...
0
by: John A Grandy | last post by:
In ASP.NET 2.0 , does the ObjectDataSource provide a method or property to return the number of rows returned ?
4
by: esmith2112 | last post by:
I have a situation that I can't explain. Boiled down to its essence, I have a query of the form SELECT A.COL1, A.COL2, B.COL1 FROM A LEFT JOIN B ON A.KEY = B.KEY This query produces 5383...
1
by: sharadadutt1981 | last post by:
hi all, I was trying to fetch even or odd number rows from database. currently i am usying DB2 ver 8.0. any one can help me out.
1
by: clickingwires | last post by:
How do you consecutively number rows in an aggregate query?
1
by: jeddiki | last post by:
Hi, I want to get a subset from my table that includes rows that have an item (cb_id) with a unique ip address ( ip_adr). To be in the subset there should be at least two rows and if there are more...
3
by: chibyke | last post by:
<table> <tr> <td>Textbox 1</td> <td>Textbox 2</td> <td>Textbox 3</td> </tr> <tr> <td>Textbox 4</td> <td>Textbox 5</td> <td>Textbox 6</td>
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.