我们如何在输出中打印最年轻的名字?我想计算最年轻的人.
那是我的代码:
#include <stdio.h>
#include <conio.h>
int main() {
int john;
int ahmad;
int saleem;
printf("Enter the age of john,ahamd, saleem simaltanoeusly\n");
scanf_s("%d\n%d\n%d", &john, &ahmad, &saleem);
int youngest = john;
if (john > ahmad)
youngest = ahmad;
if (ahmad > saleem)
youngest = saleem;
printf("youngest of you is %d", youngest);
_getch();
return 0;
}
Run Code Online (Sandbox Code Playgroud)