473,386 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how i repeat enter number of rows agin after output

#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 1289
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
no one here to ans?????????
Oct 21 '14 #3
iam_clint
1,208 Expert 1GB
What you are wanting is a loop.
Oct 21 '14 #4
thanking you ...but send me code plzzz
Oct 21 '14 #5
iam_clint
1,208 Expert 1GB
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.