MIRROR PROBLEM
Problem Description
In london, every year during dasara there will be a very grand doll show. People try to invent new new dolls of different varieties. The best sold doll's creator will be awarded with cash prize. So people broke their head to create dolls innovatively. Knowing this competition, Mr.Lokpaul tried to create a doll which sings only when a even number is pressed and the number should be greater than zero and less than 100.
So write a program to help Mr.Lokpaul to win.
Input Format:
Input Consists of Single Integer which Corresponds to Number pressed by the user to the doll.
Output Format:
Display whether the doll will Sing or not. Output consists of the string "Doll will sing" or "Invalid number".
[All text in bold corresponds to input and the rest corresponds to output.]
CODING ARENA::
#include <stdio.h>
int main()
{
int a;
scanf("%d",&a);
if(a%2==0 && a<100)
printf("Doll will sing");
else
printf("Invalid Number");
return 0;
}
Test Case 1
Input (stdin)56
Expected Output
Doll will sing
Test Case 2
Input (stdin)21
Expected Output
Invalid Number
Mirror promblem
ReplyDelete