Integer – Exactly Three Digits

The program must accept an integer N as the input. The program must print yes if exactly three digits are used to form the integer N. Else the program must print no as the output.The program must accept N string values and sort them. Then the program must print the first and the last string values.

Input :

1221255

Output :

yes

Explanation:
Here the integer 1221255 is formed using exactly three digits 1, 2 and 5.
Hence the output is yes

Here are the various methods and logic.

C++ :

#C++ code by Agent Wanda

Python :

#Python code by Agent Stark
#Python code by Agent Hawkeye
#Python code by Agent Parker
#Python code by Cherry
#Python code by Agent Cherry
#Python code by Agent Cherry

C :

#C code by Agent Steve
#C code by Agent Falcon

Leave a Reply

Your email address will not be published. Required fields are marked *

More posts. You may also be interested in.