fork download
  1. #include <iostream>
  2. using namespace std;
  3. void numWord(int,char[]); //Function Declaration
  4.  
  5. //Global Declaration Char Array With Pointer
  6.  
  7. char *one[]={""," one"," two"," three"," four"," five"," six"," seven",
  8.  
  9. “eight"," Nine"," ten"," eleven"," twelve"," thirteen"," fourteen","fifteen"," sixteen"," seventeen"," eighteen"," nineteen"};
  10.  
  11. char *ten[]={" “," “," twenty"," thirty"," forty"," fifty"," sixty","seventy"," eighty"," ninety"};
  12.  
  13. void main()
  14.  
  15. {
  16.  
  17. int n;
  18.  
  19. clrscr();
  20.  
  21. printf(“Enter any number less than 1000: \t");
  22.  
  23. scanf(%d",&n);
  24.  
  25.  
  26.  
  27. If(n>999) //Exits is n is more than 999.
  28.  
  29. printf(“–invalid.Enter a number less than 1000–\n");
  30.  
  31. else if(n<=0) //Exits If The Value Is Less Than Or Equal To “0".
  32.  
  33. printf(“Enter numbers greater than 0\n");
  34.  
  35. else if(n<100) //Prints Two Digit Numbers.
  36.  
  37. numWord((n%100),"");
  38.  
  39. else if(n%100==0) // To Print Hundred Multiples
  40.  
  41. numWord((n/100),"hundred");
  42.  
  43. else
  44.  
  45. {
  46.  
  47. numWord((n/100)," hundred and");
  48.  
  49. numWord((n%100),");
  50.  
  51. }
  52.  
  53. }
  54.  
  55. void numWord(int n,char ch[]) //Printing Function
  56.  
  57. {
  58.  
  59. (n>19)?printf(%s %s \n",ten[n/10],one[n%10]):printf(“%s “,one[n]);
  60.  
  61. printf(“%s “,ch);
  62.  
  63. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
24
compilation info
prog.cpp:9: error: stray ‘\342’ in program
prog.cpp:9: error: stray ‘\200’ in program
prog.cpp:9: error: stray ‘\234’ in program
prog.cpp:9:126: warning: missing terminating " character
prog.cpp:9: error: missing terminating " character
prog.cpp:11: error: stray ‘\342’ in program
prog.cpp:11: error: stray ‘\200’ in program
prog.cpp:11: error: stray ‘\234’ in program
prog.cpp:21: error: stray ‘\342’ in program
prog.cpp:21: error: stray ‘\200’ in program
prog.cpp:21: error: stray ‘\234’ in program
prog.cpp:21: error: stray ‘\’ in program
prog.cpp:21:46: warning: missing terminating " character
prog.cpp:21: error: missing terminating " character
prog.cpp:23: error: stray ‘\342’ in program
prog.cpp:23: error: stray ‘\200’ in program
prog.cpp:23: error: stray ‘\234’ in program
prog.cpp:23:12: warning: missing terminating " character
prog.cpp:23: error: missing terminating " character
prog.cpp:29: error: stray ‘\342’ in program
prog.cpp:29: error: stray ‘\200’ in program
prog.cpp:29: error: stray ‘\234’ in program
prog.cpp:29: error: stray ‘\342’ in program
prog.cpp:29: error: stray ‘\200’ in program
prog.cpp:29: error: stray ‘\223’ in program
prog.cpp:29: error: stray ‘\342’ in program
prog.cpp:29: error: stray ‘\200’ in program
prog.cpp:29: error: stray ‘\223’ in program
prog.cpp:29: error: stray ‘\’ in program
prog.cpp:29:56: warning: missing terminating " character
prog.cpp:29: error: missing terminating " character
prog.cpp:33: error: stray ‘\342’ in program
prog.cpp:33: error: stray ‘\200’ in program
prog.cpp:33: error: stray ‘\234’ in program
prog.cpp:33: error: stray ‘\’ in program
prog.cpp:33:41: warning: missing terminating " character
prog.cpp:33: error: missing terminating " character
prog.cpp:49:17: warning: missing terminating " character
prog.cpp:49: error: missing terminating " character
prog.cpp:59: error: stray ‘\342’ in program
prog.cpp:59: error: stray ‘\200’ in program
prog.cpp:59: error: stray ‘\234’ in program
prog.cpp:59: error: stray ‘\’ in program
prog.cpp:59:26: warning: missing terminating " character
prog.cpp:59: error: missing terminating " character
prog.cpp:61: error: stray ‘\342’ in program
prog.cpp:61: error: stray ‘\200’ in program
prog.cpp:61: error: stray ‘\234’ in program
prog.cpp:61: error: stray ‘\342’ in program
prog.cpp:61: error: stray ‘\200’ in program
prog.cpp:61: error: stray ‘\234’ in program
prog.cpp:9: error: ‘eight’ was not declared in this scope
prog.cpp:9: error: expected `}' before string constant
prog.cpp:9: error: expected ‘,’ or ‘;’ before string constant
prog.cpp:13: error: ‘::main’ must return ‘int’
prog.cpp: In function ‘int main()’:
prog.cpp:19: error: ‘clrscr’ was not declared in this scope
prog.cpp:21: error: ‘Enter’ was not declared in this scope
prog.cpp:39: error: ‘else’ without a previous ‘if’
prog.cpp:41: warning: deprecated conversion from string constant to ‘char*’
prog.cpp:47: warning: deprecated conversion from string constant to ‘char*’
prog.cpp:51: error: expected primary-expression before ‘}’ token
prog.cpp:51: error: expected `;' before ‘}’ token
prog.cpp: In function ‘void numWord(int, char*)’:
prog.cpp:59: error: expected primary-expression before ‘%’ token
prog.cpp:59: error: ‘s’ was not declared in this scope
prog.cpp:61: error: expected `:' before ‘;’ token
prog.cpp:61: error: expected primary-expression before ‘;’ token
stdout
Standard output is empty