fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int i , n , firstDigit , secondDidit , thirdDigit ;
  6. cout << "Enter the number : ";
  7. cin >> i;
  8. cout<< "\n";
  9. if (i>=100 && i<=999){
  10. firstDigit = i / 100;
  11. n = i / 10;
  12. secondDigit = n /10;
  13. thirdDigit = n % 10;
  14.  
  15. } else {cout << "Enter a number exists in the limited range!!" ; }
  16. return 0;
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
256
compilation info
prog.cpp: In function 'int main()':
prog.cpp:12:3: error: 'secondDigit' was not declared in this scope
   secondDigit = n /10;
   ^
stdout
Standard output is empty