473,385 Members | 1,154 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,385 software developers and data experts.

Printing number of zeros the user asks for

I am having trouble with making my program print the number of zeros the user inputs. My program prompts the user to input a number, then it prints out zeros based on the number they input. For example, if the user types in 5, my program prints out "5 zeros: 00000." We are working on do while loops if that helps any. My program as of now compiles and works correctly other than the fact that it is only printing 1 zero no matter what they input.
Oct 3 '16 #1
2 1113
Oralloy
988 Expert 512MB
astrickler15,

We can't offer any suggestions at this point without seeing what you've written.

Will you please show us a copy of your code. Please use code blocks to make it easily readable.

Thanks,
Oralloy
Oct 3 '16 #2
weaknessforcats
9,208 Expert Mod 8TB
Use a while loop. Have the loop print a 0. If the user enters 5, cycle the loop 5 times.

Expand|Select|Wrap|Line Numbers
  1. while (n)
  2. {
  3.   printf('0');  
  4.   --n;
  5. }
Oct 3 '16 #3

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

Similar topics

0
by: John Shum | last post by:
I prepare a UserControl that act as a lookup control, once the code is enter in the TextBox, the description will appear in another TextBox outside the UserControl of the same row in a DataGrid via...
0
by: Jayesh Fojdar | last post by:
hi i have installed vs.net 2002 with .net framework 1.0 sp3 the problem i am facing is as follows i have a report displayed in cr viewer and now when i print the report thru print dialog of...
13
by: td0g03 | last post by:
Hello again guys. I have a question. I'm working on a program for my class and I'm stuck on how to find the lowest and highest number of a user input. We aren't at arrays yet so that's out of the...
10
by: strife | last post by:
Hi, This is a homework question. I will try to keep it minimal so not to have anyone do it for me. I am really just stuck on one small spot. I have to figure out the highest number from a users...
9
by: rohitchawla | last post by:
The only way i know is either using combinations like var a=Math.round(Math.random()*1000000); var b=Math.round(Math.random()*1000000); var c=Math.round(new Date().getTime()/1000); d=a+""+b;...
1
by: =?Utf-8?B?VGVycnk=?= | last post by:
I have an application where the user can configure the an area of the UI to contain a variable number of 'plans', lets say 0 to 6 of them. Each 'plan' has a description and a type amongst other...
3
by: simon2x1 | last post by:
i need a code that will tell me the number of user that visited that particular web page for that day
1
by: Karan Singh Goyal | last post by:
I have an access table which have fields like Customer Id, First Name, Last Name etc. i know how to generate auto number but when i delete last record it generates next number instead of previous one...
5
by: Bernardo | last post by:
Okay, so I am making a program that accepts user input of integers. As you can see I am using an array and i need to get the greatest number, and smallest, range, mean, etc. But I successfully did...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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...

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.