/*********************************************
Write out zip code
Write a program that reads in a zip code and
writes it out as words. A typical run of the
program might look like:
Enter zip code: 21218
two one two one eight
*********************************************/#include <iostream>#include <string>usingnamespacestd;stringdigitname(char);/*********************************************
** main() function
*********************************************/intmain(){/******************************************
Read in each of the 5 digits of the zip
code as a character, and write it out as
the full string
*******************************************/cout<<"Enter zip code: ";for(inti=0;i<5;i++){charc;cin>>c;cout<<digitname(c)<<' ';}cout<<endl;return0;}/*********************************************
** digitname - takes a char argument storing
** a digit, and returns the digit as a string.
** ex digitname('2') returns "two".
*********************************************/stringdigitname(charc){if(c=='0')return"zero";elseif(c=='1')return"one";elseif(c=='2')return"two";elseif(c=='3')return"three";elseif(c=='4')return"four";elseif(c=='5')return"five";elseif(c=='6')return"six";elseif(c=='7')return"seven";elseif(c=='8')return"eight";elseif(c=='9')return"nine";elsereturn"error";}