Convert uppercase letters in a string to lowercase letters
The program code is as follows:
1 /*2 March 8, 2017 21:21:463 function: Convert uppercase letters in a string to lowercase letters4 */5 /*6 #include "stdio.h"7 8 int main ()9 {Ten int n = 0; One A Char a[100]; - - printf ("Please input a string:"); the - gets (a); - - for (int i = 0; A[i]! = ' + '; i++) + { - + n++; A at } - - For (int j = 0;j < N; j + +) - { - - if (a[j] >= ' A ' && a[j] <= ' Z ') in { - to A[j] = a[j] + +; + - } the * } $ Panax Notoginseng puts (a); - the }*/ + A#include"stdio.h" the + intMain () - { $ Chara[ -]; $ - Char*p =A; - theprintf"Please input a string: \ n"); - Wuyi gets (a); the - while(*p) Wu { - About if(*p >='A'&& *p <='Z') $ { - -*p = *p + +; - A } + thep++; - $ } theprintf"The result is: \ n"); the puts (a); the } the /* - Summary: in results shown in vc++6.0: the —————————————————————————————— the Please input a string: About Asdsdffgj the The result is: the Asdsdffgj the —————————————————————————————— + */
C Language Code Programming Summary: Convert uppercase letters in a string to lowercase letters