写一段C++程序 判断数值A 介于B和C之间
时间: 2024-05-08 21:19:14 浏览: 193
Sure, here's a C program that checks if a value A falls between values B and C:
```c
#include <stdio.h>
int main() {
int a, b, c;
// Prompt user to input values for A, B, and C
printf("Enter value for A: ");
scanf("%d", &a);
printf("Enter value for B: ");
scanf("%d", &b);
printf("Enter value for C: ");
scanf("%d", &c);
// Check if A is between B and C
if (a > b && a < c) {
printf("A is between B and C.\n");
} else {
printf("A is not between B and C.\n");
}
return 0;
}
```
阅读全文