troubleshooting Question

Program requesting an integer

Avatar of captainx01
captainx01 asked on
C
1 Comment1 Solution236 ViewsLast Modified:
Write a program to request an integer n from 1 to 9 and  print a line and print a line of output consisting of ascending digits from 1 to n followed by desecending digits from n - 1 to 1. For example, if n = 5, print the line
   123454321
//program requesting an integer from 1 to 9 and print a line of digits
//in asscending digits from 1 to the integer
#include <stdio.h>
main(){
       int n, count;
       printf ("please enter an number from 1 - 9:");
       scanf ("\n%d",&n);{
       if ((n>=1) &&(n<=9));
       {
       printf ("\n\n%d",&n);
       
       for {(count =1; count <n; count ++);
       
       printf ("%d", count);
       printf ("%d", n);
       
       for (count=count - 1; count >=1; count --);
       }
       printf ("%d",&count);
       system ("pause");
       }
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros