Question: Please write the code in C 1. Write a program that asks the user to enter an international dialing code and then looks it up

Please write the code in C

Please write the code in C 1. Write a program that asksthe user to enter an international dialing code and then looks itup in the country_codes array.If it finds the code, the program should

1. Write a program that asks the user to enter an international dialing code and then looks it up in the country_codes array.If it finds the code, the program should display the name of the corresponding country; if not, the program should print an error message. Enter dialing code: : 54 The country with dialing code 54 is Argentina. Enter dialing code : 100. No corresponding country found. const struct dialing_code country_codes[] = {{"Argentina", 54}, {"Bangladesh", 880), {"Brazil", 55}, {"Burma (Myanmar)", 95), {"China", 86}, {"Colombia", 57}, {"Congo, Dem. Rep. of", 243}, {"Egypt", 20}, {"Ethiopia", 251}, {"France", 33}, {"Germany", 49}, {"India", 91}, {"Indonesia", 62}, {"Iran", 98}, {"Italy", 39}, {"Japan", 81}, {"Mexico", 52}, {"Nigeria", 234}, {"Pakistan", 92}, {"Philippines", 63}, {"Poland", 48}, {"Russia", 7}, {"South Africa", 27}, {"South Korea", 82}, {"Spain", 34}, {"Sudan", 249}, {"Thailand", 66}, {"Turkey", 90}, {"Ukraine", 380}, {"United Kingdom", 44}, {"United States", 1}, {"Vietnam", 84}}; Enter dialing code: 54 The country with dialing code 54 is Argentina Process exited after 1.475 seconds with return value 0 Enter dialing code: 100 No corresponding country found Process exited after 1.313 seconds with return value 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!