Search⌘ K
AI Features

Teeny Tiny Math

Learn to analyze and predict the output of simple math puzzles written in C. This lesson helps you explore fundamental coding logic and enhances your understanding of input and output behavior in C programs.

We'll cover the following...

Puzzle code

Read carefully the code given below:

C
#include <stdio.h>
int main()
{
int a;
printf("Enter an integer: ");
scanf("%d", &a);
printf("%d\n", a<<1);
printf("%d\n", a>>1);
return(0);
}

Your task: Guess the output

Attempt the following test to assess your understanding.

Technical Quiz
1.

What will be the output if the user enters the integer 8?

A.

16
4

B.

8
4

C.

16
8

D.

4
16


1 / 1

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