1. Engineering
  2. Computer Science
  3. the first letter response from the first input gets cut...

Question: the first letter response from the first input gets cut...

Question details

The first letter response from the first input gets cut off...I don't know why. How can I fix this?
Also, when I do multiple word input like "how are you" it shows me "HOWAREYOU" (without spaces)...how can I account for the spaces?

------------------------------------

#include <stdio.h>

int main(){

int c = getchar();
while( c != EOF)
{
c = getchar(); /* read again */
c&='_'; /* perform 'and' operation with '_' to get upper case letter. */
putchar(c);
}
return 0;
}

---------------------------

OUTPUT should look like this:

Hello The World

HELLO THE WORLD

How Old Are You?

HOW OLD ARE YOU?

I am 24, and THANKs!

I AM 24, AND THANKS!

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution