2 Replies - 532 Views - Last Post: 01 March 2009 - 07:52 PM Rate Topic: -----

#1 inmonb  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 27-February 09

I am having problems trying to get my application to display asterisks

Posted 01 March 2009 - 07:39 PM

:)

 int num1, num2, num3, num4, num5, x; /* declare variables */

	printf("Enter 5 numbers between 1 and 30:"); /* prompt for input */
	scanf("%d%d%d%d%d", &num1, &num2, &num3, &num4, &num5 ); /* read numbers from user */
                    System.out.print("*");
        
        int main( void ) /* function main begins program execution */
{
	int num1, num2, num3, num4, num5, x; /* declare variables */

	printf("Enter 5 numbers between 1 and 30:"); /* prompt for input */
	scanf("%d%d%d%d%d", &num1, &num2, &num3, &num4, &num5 ); /* read numbers from user */


*edit: Please use code tags in the future, thanks! :code:

This post has been edited by Martyr2: 01 March 2009 - 07:48 PM


Is This A Good Question/Topic? 0
  • +

Replies To: I am having problems trying to get my application to display asterisks

#2 BigAnt  Icon User is offline

  • May Your Swords Stay Sharp
  • member icon

Reputation: 101
  • View blog
  • Posts: 2,392
  • Joined: 16-August 08

Re: I am having problems trying to get my application to display asterisks

Posted 01 March 2009 - 07:46 PM

Please put your question in the post body not title as it will get cut off.

What do you wish to display the entered number of asterisks?

Also the code you are giving is not valid java syntax, are you sure you are doing Java?
Was This Post Helpful? 0
  • +
  • -

#3 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4361
  • View blog
  • Posts: 12,180
  • Joined: 18-April 07

Re: I am having problems trying to get my application to display asterisks

Posted 01 March 2009 - 07:52 PM

This is C code (except for the one line attempting to print using System.out.print - ???), so moved to the C/C++ forum. Please remember to post to the right forum.

As for printing asterisks according to the number they entered, look into using a for loop. You can find examples of this on the net very easily. We also have some code in our snippets/tutorials/blogs that may prove useful to you.

Thanks for following the rules in the future. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1