Computing.Net > Forums > Unix > Display a character n times..

Display a character n times..

Reply to Message Icon

Original Message
Name: deeps
Date: July 10, 2006 at 13:01:17 Pacific
Subject: Display a character n times..
OS: Unix/Windows
CPU/Ram: 1GB
Comment:

How can a print a character n times on output screen.
For example, i wish to display character "%" 10 times.
Thanks.


Report Offensive Message For Removal

Response Number 1
Name: deeps
Date: July 10, 2006 at 13:01:58 Pacific
Subject: Display a character n times..
Reply: (edit)

If the same can be shown in perl


Report Offensive Follow Up For Removal

Response Number 2
Name: deeps
Date: July 14, 2006 at 10:52:51 Pacific
Subject: Display a character n times..
Reply: (edit)

Does anyone have a concise statement for this command.

print "%%%%%%%%%%";

Instead could there be a one line such as

print "%",10times;

This has to be done without using a loop.


Report Offensive Follow Up For Removal

Response Number 3
Name: deeps
Date: July 14, 2006 at 11:29:06 Pacific
Subject: Display a character n times..
Reply: (edit)

Got that...

For help of others,

print "%" x 10

The above statement is for perl

Please do contribute to the forum.


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Display a character n times..

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software