Can anyone tell me how can i write a program where i have to read a c program from a text file and then count the number of if-else statements, excluding the nested if-else.
Her
Without seeing the original file to read, I would use regex to count the total number of if/else and then count the number of nested if/else. The math for the result should be pretty simple... :)