New drivers license (code coach) test case 5 not passed Why. C LANGUAGE | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

New drivers license (code coach) test case 5 not passed Why. C LANGUAGE

#include <stdio.h> #include <string.h> int main() { char arr[20]; char arr2[50]; int num; scanf("%s\n %d\n",arr,&num); fgets(arr2,sizeof(arr2), stdin); int s= strlen(arr2); int min = 20; int plus =0; int d; for(int i=0; i<s; i++){ if(arr2[i] >= 'A' && arr2[i] <= 'Z'){ if(arr[0] > arr2[i] && num == 1){ plus += 20; } } } d= min + (plus/num); printf ("%d", d); return 0; }

14th May 2021, 6:59 AM
Vishal
Vishal - avatar
4 Answers
0
for(int i=0; i<s; i++){ if(arr2[i] >= 'A' && arr2[i] <= 'Z'){ if(arr[0] > arr2[i] && num == 1){ plus += 20; }else if(arr[0] > arr2[i] && num == 3){ plus += 20; } } }
14th May 2021, 12:44 PM
Bahhaⵣ
Bahhaⵣ - avatar
30th Jul 2021, 7:08 AM
Ankit Kumar
Ankit Kumar - avatar
+ 1
Bhai it works in all cases
30th Jul 2021, 7:09 AM
Ankit Kumar
Ankit Kumar - avatar
0
Thank you Bahha
14th May 2021, 2:23 PM
Vishal
Vishal - avatar