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]);
```
You might also like to view...
When you start your Mac, the operating system starts automatically; it activates desktop, which provides access to files and programs on your computer.
Answer the following statement true (T) or false (F)
A ____ is a data structure that looks like an upside-down tree.
A. graph B. heap C. binary tree D. B-tree
What are some of the items that a security policy should include?
What will be an ideal response?
_________-density data refers to large volumes of very detailed data in which many of the details are not important.?
Fill in the blank(s) with the appropriate word(s).