Computer Science, asked by vanshika0206, 5 months ago


A company is transmitting data to another server. The data is in the form of numbers. To secure
the data during transmission, they plan to obtain a security key that will be sent along with the
data. The security key is identified as the count of the unique repeating digits in the data.
Write an algorithm to find the security key for the data.
Input
The input consists of an integer data, representing the data to be transmitted.
Output
Print an integer representing the security key for the given data.

Answers

Answered by swetharsha174
2

Answer:

578378923

Explanation:

the repeated digits in the data are 7,8,3so security key is 3

Answered by mahimapanday53
0

Concept:

The act of describing a problem, discovering the origin of the problem, finding, prioritising, and selecting potential solutions for a solution, and executing a solution is referred to as problem solving.

The programmer is responsible for expressing the answer to the issue in terms of basic procedures that the computer can comprehend and perform. Problem-solving is a step-by-step process of examining facts about a problem and coming up with effective responses.

Find:

The algorithm to find the key for the data.

Program:

\# includ < stdio.h > \\int \quad main()\\\{\\long \quad int \quad n;\\scanf("\%ld", \&n);\\int \quad a[10]=\{0\};\\while \quad (n)\\\{\\a[n \% 10]++;\\n=n/10;\\\}\\\\int \quad i,sk=0;\\for(i=0;i < 10;i++)\\\{\\if(a[i] > 1)\\.\quad sk++;\\\}\\if(sk==0)\\.\quad sk=-1;\\printf("\%d", sk);\\\}

Hence, the above program prints the security key.

#SPJ3

Similar questions