#include <stdio.h>
// Function prototype
int MinIn3(int x, int y, int z);
int main() {
int a, b, c;
// Prompt user for input
printf("Enter 3rd number: "); // Corrected "3th" to "3rd"
// Call function to find the minimum and display the result
printf("Minimum is %d\n", MinIn3
(a
, b
, c
));
return 0;
}
// Function to find the minimum of three numbers
int MinIn3(int x, int y, int z) {
int min = x; // Assume x is the minimum initially
if (y < min) {
min = y; // Update min if y is smaller
}
if (z < min) {
min = z; // Update min if z is smaller
}
return min; // Return the smallest number
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgovLyBGdW5jdGlvbiBwcm90b3R5cGUKaW50IE1pbkluMyhpbnQgeCwgaW50IHksIGludCB6KTsKCmludCBtYWluKCkgewogICAgaW50IGEsIGIsIGM7CiAgICAKICAgIC8vIFByb21wdCB1c2VyIGZvciBpbnB1dAogICAgcHJpbnRmKCJFbnRlciAxc3QgbnVtYmVyOiAiKTsKICAgIHNjYW5mKCIlZCIsICZhKTsKICAgIAogICAgcHJpbnRmKCJFbnRlciAybmQgbnVtYmVyOiAiKTsKICAgIHNjYW5mKCIlZCIsICZiKTsKICAgIAogICAgcHJpbnRmKCJFbnRlciAzcmQgbnVtYmVyOiAiKTsgLy8gQ29ycmVjdGVkICIzdGgiIHRvICIzcmQiCiAgICBzY2FuZigiJWQiLCAmYyk7CiAgICAKICAgIC8vIENhbGwgZnVuY3Rpb24gdG8gZmluZCB0aGUgbWluaW11bSBhbmQgZGlzcGxheSB0aGUgcmVzdWx0CiAgICBwcmludGYoIk1pbmltdW0gaXMgJWRcbiIsIE1pbkluMyhhLCBiLCBjKSk7CiAgICAKICAgIHJldHVybiAwOwp9CgovLyBGdW5jdGlvbiB0byBmaW5kIHRoZSBtaW5pbXVtIG9mIHRocmVlIG51bWJlcnMKaW50IE1pbkluMyhpbnQgeCwgaW50IHksIGludCB6KSB7CiAgICBpbnQgbWluID0geDsgLy8gQXNzdW1lIHggaXMgdGhlIG1pbmltdW0gaW5pdGlhbGx5CiAgICAKICAgIGlmICh5IDwgbWluKSB7CiAgICAgICAgbWluID0geTsgLy8gVXBkYXRlIG1pbiBpZiB5IGlzIHNtYWxsZXIKICAgIH0KICAgIAogICAgaWYgKHogPCBtaW4pIHsKICAgICAgICBtaW4gPSB6OyAvLyBVcGRhdGUgbWluIGlmIHogaXMgc21hbGxlcgogICAgfQogICAgCiAgICByZXR1cm4gbWluOyAvLyBSZXR1cm4gdGhlIHNtYWxsZXN0IG51bWJlcgp9Cgo=