What is the error in the given C language program?
Categories: Education
Mistakes are the issues or the deficiencies that happen in the program, which makes the way of behaving of the program strange, and experienced designers can likewise make these shortcomings. Programming blunders are otherwise called the bugs or blames, and the most common way of eliminating these bugs is known as troubleshooting.
These mistakes are distinguished either during the hour of gathering or execution. Consequently, the blunders should be eliminated from the program for the effective execution of the program.
There are primarily five kinds of blunders exist in C programming:
1. Grammar blunder
2. Run-time mistake
3. Linker mistake
4. Sensible blunder
1. Grammar blunder
Grammar blunders are otherwise called the accumulation mistakes as they happened at the gathering time, or we can say that the punctuation mistakes are tossed by the compilers. These blunders are fundamentally happened because of the errors while composing or don't follow the sentence structure of the predefined programming language. These errors are for the most part made by amateurs simply because they are new to the language. These mistakes can be effortlessly repaired or revised.
2. Run-time mistake
Once in a while the blunders exist during the execution-time even after the effective gathering known as run-time mistakes. At the point when the program is running, and it can't play out the activity is the primary driver of the run-time blunder. The division by zero is the normal illustration of the run-time mistake. These mistakes are undeniably challenging to track down, as the compiler doesn't highlight these blunders.
3. Linker blunder
Linker blunders are for the most part produced when the executable record of the program isn't made. This can be happened either because of some unacceptable capability prototyping or utilization of some unacceptable header record. For instance, the main.c document contains the sub() capability whose statement and definition is finished in some other record, for example, func.c. During the assemblage, the compiler views as the sub() capability in func.c record, so it creates two article documents, i.e., main.o and func.o. At the execution time, if the meaning of sub() capability isn't found in the func.o record, then, at that point, the linker mistake will be tossed. The most widely recognized linker blunder that happens is that we utilize Principal() rather than primary().
4. Intelligent blunder
The intelligent blunder is a mistake that prompts an undesired result. These mistakes produce the erroneous result, yet they are without blunder, known as intelligent mistakes. These kinds of errors are predominantly finished by fledglings. The event of these mistakes principally relies on the sensible reasoning of the designer. In the event that the developers sound coherently great, there will be less possibilities of these mistakes.