there are 5 tunnels. if a person visit, tunnel 2 and 3, print gold, if he visit tunnel 4 and 5, print brass, if he visit only tunnel 4, print soil
if he visit tunnel 1, notify wrong entry.
pls fast. ill mark you as brainliest
Answers
Answered by
2
Explanation:
let me answer the question in 'C' language (since the language is not specified)
also, i suppose one person can enter one tunnel at a time.
if i am wrong please explain your question clearly , so that i can understand.
#include <stdio.h>
int main()
{
int x;
printf("Please enter the Tunnel Number:");
scanf("%d", &x);
if (x <1 || x>5)
{
printf("Please enter Tunnel number from 1 to 5\n");
}
if (x==2 || x==3)
{
printf("Gold\n");
}
if (x==5)
{
printf("Brass\n");
}
if (x==4)
{
printf("Soil\n");
}
if (x==1)
{
printf("Wrong Entry\n");
}
printf("End of Program");
return 0;
}
Similar questions
English,
3 months ago
English,
3 months ago
Science,
3 months ago
Computer Science,
6 months ago
Geography,
11 months ago