I'm new to C and programming. I was stuck in homework practice. My output only shows the first letter in upper case, and shows the following characters in some weird numbers. Can someone take a look at my code and give me some wrong suggestions and some suggestions on ways to fix this issue? Your help is greatly appreciated! "Sticky capsâ" () to modify the word "sticky" or "random" to a sticky type (four * words) where the word is a word, such as "sticky" or "random."
, That is, the letters should be in alternative matters (upper and lower), which will start with the upper case of the first letter. For example, a pseudo sticks, and "pseudo" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" '' '' '' '' '' '' '' '' String, which "??? \ \ ". You can assume that the legal string is provided on the pasting function."
#include & lt; Stdio h & gt; # Include & lt; Stdlib.h & gt; Converts CH to the upper case, it is assuming that it is currently in the following case / four from uppercase (four f) {return CH- 'A' + 'A'; } / * CH converts in short case, assuming that it is currently in the upper case * / char to lower case (four f) {return ch-'A '+' a '; } For sticky caps * / for (int i = 0; i }
int main () {/ * scanf * / char; Four * input; Input = word; Printf ("Please enter the word: \ n"); Scanf ("% s", input); / * Sticky call * / sticky (input); / * Print new words * / printf ("% s", input); For (int i = 0; i & lt; sizf (input); i ++) {if (input [i] == '\ n') {input [i] = '\ 0'; break; }} Return 0; }
you do not have strlen sizeof to find a four * string length
No comments:
Post a Comment