Answers for "The closest in between"

C
0

The closest in between

int num;
  
  int x;
  
  printf("Enter the total number of our men: ");
  scanf("%d", &num);
  
  int men[num];
  int n,n1;
  
  for(x=1; x<=num; x++){
  	
  
  printf("Men #%d: ", x);
  scanf("%d", &men[x]);
  
  //if(x>=num+1)
  
  }
  
  printf("Enemy #1: ");
  scanf("%d",&n);
  
  printf("Enemy #2: ");
  scanf("%d",&n1);  
  
   printf("\nMen Cornered:\n");
  
  for(x=1; x<=num; x++){
  	
  if(men[x]<=n1 && men[x]>=n){
    
   
    printf("%d ",men[x]);
  
  }}
Posted by: Guest on March-11-2022

Code answers related to "The closest in between"

Code answers related to "C"

Browse Popular Code Answers by Language