Avatar of captainx01
captainx01
 asked on

Program requesting an integer

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");
       }

Open in new window

C

Avatar of undefined
Last Comment
mrjoltcola

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
mrjoltcola

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy