Hey guys. i am trying to write a program which will read input from a text file, check if each line contains any alphabets and then display a message imforming me if there is an alphabet in each line. My text file is formatted in this way...
1 2 3 4
123
562
red
21e
Based on this example, the expected output of my program would be..
Consider switching the order of the statement as a general practice. If you had written the following line of code the compiler would have helped you.
1 2 3 4 5 6 7
// This won't compile
if(1 = check)
// this compiles but is wrong and results in unexepected run-time behavior.
// The result of the expression is 1 so the test is always true because check is
// assigned the value of 1
if(check = 1)