The Program in C that merges three numbers is given below:
#include <stdio.h>
int main() {
int num1, num2, num3, merged_num;
printf("Enter the first number: ");
scanf("%d", &num1);
printf("Enter the second number: ");
scanf("%d", &num2);
printf("Enter the third number: ");
scanf("%d", &num3);
//merging the numbers
merged_num = num1 * 100 + num2 * 10 + num3;
printf("The merged number is: %d", merged_num);
return 0;
}
Output:
Enter the first number: 23
Enter the second number: 26
Enter the third number: 55
The merged number is: 2615
Pro-Tips:💡
This program prompts the user to enter three numbers, then it uses arithmetic to combine the digits of those numbers into a single number.
It works by multiplying the first number by 100, the second number by 10, and adding those values to the third number.
Learn C-Sharp ↗
C-sharp covers every topic to learn about C-Sharp thoroughly.
Learn C Programming ↗
C-Programming covers every topic to learn about C-Sharp thoroughly.
Learn C++ Programming↗
C++ covers every topic to learn about C-Sharp thoroughly.