I can't seem to find a direct answer on this. Using several search engines gives me very vague results, or only answers half the question.
So, to elaborate, when you write a program and it's compiled/interpreted, does the computer read each line sequentially in chronological order or does it skip around by default?
Example: Using C-style source because it was the first thing that came to mind.
printf("I'm the first line of your program! Yay!");
printf("I'm the second, woo!");
printf("And I'm the third, yay!");
Above you can see there are three lines of code, and when run, they will be run in order and outputted to the console in said order.
I am assuming that, unless told to jump to a specific part of code within the source file, it will read each line of code in order. So is this how a program is interpreted in a computer, and do all programming languages get compiled/interpreted this way? Is how a program read language specific?
I know this is a basic question about programming languages and computer science, but I'd like some clarification and there aren't any concrete answers out there.
I probably worded the question incorrectly with my searches - that might be why I didn't find anything. Thanks!