Search⌘ K
AI Features

On the Case

Explore C programming puzzles designed to improve your logic and output prediction skills. This lesson helps you analyze code carefully and practice assessing its behavior, enhancing your problem-solving abilities in C.

We'll cover the following...

Puzzle code

Read carefully the code given below:

C
#include <stdio.h>
int main()
{
char a;
for( a='A'; a<='Z'; a++ )
putchar( a | 0x20 );
putchar('\n');
for( a='a'; a<='z'; a++ )
putchar( a & 0xdf );
putchar('\n');
return(0);
}

Your task: Guess the output

Attempt the following test to assess your understanding.

Technical Quiz
1.

What is the expected output of the above code?

A.
ABCDEFGHIJKLMNOPQRSTUVWXYZ  
ABCDEFGHIJKLMNOPQRSTUVWXYZ
B.
abcdefghijklmnopqrstuvwxyz  
abcdefghijklmnopqrstuvwxyz
C.
abcdefghijklmnopqrstuvwxyz  
ABCDEFGHIJKLMNOPQRSTUVWXYZ
D.
ABCDEFGHIJKLMNOPQRSTUVWXYZ  
abcdefghijklmnopqrstuvwxyz

1 / 1

Let's discuss the code and output together in the next lesson.