Question 69: Enter a character string (with no more than 20 in length and no spaces) on the keyboard, copy it, and convert all lowercase letters to uppercase letters when copying.
#include <stdio.h>
void main()
{ char a[20]; int i; printf("Please enter a string of English letters:\n"); gets(a); for (i=0 ;i<20;i++) if(a[i]>='a'&&a[i]<='z') a[i]-=32; a[20]='\0'; puts(a) ; }
One question per day 69
Guess you like
Origin blog.csdn.net/drake_gagaga/article/details/114108104
Recommended
Ranking