Complete the code fragment below so that it displays on the same line the first alphabetic letter in str and the last digit in str. You may assume that str contains at least one alphabetic letter and at least one digit.
```
int fst_let, last_dig; /* positions of first letter, last digit */
char str[30];
int i;
printf("Enter a string> ");
scanf("%s", str);
```
```
for (fst_let = 0; !isalpha(str[fst_let]); ++fst_let);
for (last_dig = strlen(str) - 1;
!isdigit(str[last_dig]);
--last_dig);
]
printf("%c %c\n", str[fst_let], str[last_dig]);
```
Computer Science & Information Technology
You might also like to view...
Use the __________ property to configure a maximum width for an element
a. width b. maximum-width c. max-width d. width-max
Computer Science & Information Technology
To toggle between showing and hiding comments, click the Show Comments list arrow, then click the ____ button
A. Toggle Comments B. Show Markup C. Hide/Show D. Hide Comments
Computer Science & Information Technology