Difference Between Compile-time, Run-time, And Logical Error | Lesson-15 | Learn C Programming

preview_player
Показать описание
In this video, I will be talking about the different types of errors in programming.

We will be understanding the different types of errors - compile-time error, run-time error, and logical error by writing faulty code and then rectifying them to clear the error.

To watch the next video of this C programming Series, click on the link below.

If you haven't yet watched the previous lesson of this series, make sure you watch it before moving further on this C programming series by clicking on the link below.

To be a part of our exclusive community on Telegram who are following this C programming series with you, make sure you click on the link below and join our Telegram Channel.

For notes, you can also refer the online book written by Subhash K U by following the link below.

Рекомендации по теме
Комментарии
Автор

compile time errors : errors occurs during compilation whether there is a problem with the syntax.
run time errors: errors occurs during execution of a program whether there is a problem in the illegal instructions .
logical errors: errors occurs during execution because there is problem in the unwanted logical code in the program.

sameerak
Автор

Compile time error: It is also called syntax error.
Errors we get during compilation process is called as compile time error.It occurs bz of wrong syntax.
Example: When we miss semicolon in the printf statement.
Run- time error: Errors we get during program execution.
Example:Dividing a number by zero.
Logical error:These type of error occur bz of problem in problem logic.
U'll get the o/p but not the desired o/p.

sasmitadas
Автор

1.Compile time error are syntax error related to c source code. Those error you will get. when compile the program during that error are the compiler error.
2.Runtime error are - CPU not able to execute the program that is called runtime error.
3. Logical error- if you write programming
Logic. In that logic you did write wrong that is called logical error

kasimanvenky
Автор

in Compile time error there is a mistake in syntax and it will not compile, run time error occurs while the programming is running it will compile and execute but stop where there is error . In logical error we made mistake in mathematical expression it will compile and execute but we don't get desired output

sushanthchandan
Автор

>Compile time error occur when there is any syntax error in source code like missing of ' ; ' .

>Run time error occur when illegal instruction in a source code

>Logical error occur when there is problem with code logic

_ganeshkasar
Автор

compilation error: compilation error occur when compiler finds the source code to be not in a structured format like syntax error which throws a compilation error
Ex:
#include<stdio.h>
int main()
{
int a=5;
int b=1;
int c=a+b;
printf("the sum of a and b is %d"c); /* this gives a syntax error cuz i haven't placed ", " after %d" this is syntax error and throws compile error*/
}

runtime error: this occurs when we give unconditional statements in the source code this results terminating the program from running
Ex:
#include<stdio.h>
int main()
{
int a=5;
int b=0;
float c=a/b;
printf("the value of c is %f", c);
}

logical error: this occurs when we made a mistake in defining the proper logic to execute the program if we made a mistake in defining logic it execute the program an throws a wrong output.
EX;
#include<stdio.h>
int main()
{
int a=-5;
int b=-14;
float c=a-b/2;
printf("the sum of a and b is %f", c);
}
thanks sir

manojkumar-kope
Автор

compile time error occur only when there is syntax error.
run time error will occur when we run the code in this CPU is not able to execute the code.
logical error occurs only when there is any error in logic, in this we will not get a desired output.

kcankith
Автор

Compile time errors:
Those errors that you get during your compilation process.
run time errors:
Those errors that you get during the program execution.
When the CPU is not execute your source code because of illegal instructions.
Logical errors :
Those errors that occurs because of the problem in code logic.

shreyamukkawar
Автор

Compile time error or compilation error : (also called syntax) error occurs during compiling the source code because of problem in the syntax of the program
Example: missed out (;)in the code

Run time error: occurs during executing the program because of illegal instructions
Example:any number/zero

Logical error: when there is a problem with its logical of the program...there won't be a desire output

dhanyam
Автор

Compile time error:
This type of error occurs, where compiler enocountered a invalid syntax
ex:
#include<stdio.h>
int main()
{
int a = 5, b = 4;
print("a=%d, b=%d\n", a, b);

-->Here, no closing paranthesis was given.it gives a compile time error.
when we cleared out those errors, after that pgm going to create binary file and starts execution.


Run time error:
Program starts compiling, if there is no compile time error, binary file was created.
then execution getting started..during that runtime, CPU find any illegal instructions(not executable) those are
called run-time errors.


Logical error:
If any pgm has no run-time error and compile time error, executed successfully.
but output of the program was not exactly correct.
This type error occurs, when logic of code was incorrect.
ex:
#include<stdio.h>
int main()
{
int a = 5, sum;
char b = 'd';
sum = a / b;
printf("sum=%d", sum);
}
o/p: sum = 0

devaarasi
Автор

Compile time error:
The error we get during compilation process. Its means the problem with the syntax.
Example:
If we miss any semicolon ';' it throws a compile time error.

Run time error:
The error we get during program execution. The source code is compiled successfully and the binary file will also be generated. But in between the CPU is unable to execute the code.
Example:
Doing operations like 1/0 which is illegal.

Logical error:
If the program logic is wrong, the compiler wouldn't give the desired output.

s_hilpa
Автор

Compile time error :- The error occurs due to incorrect syntax of the program.
It occurres
at the time of compilation of program
Runtime error :- occurs at the time of program execution due to illegal instructions in the code
Logical error :- occurs due to incorrect logic.

diptijadhav
Автор

Compile time errors: occurs at syntax mistakes in the code
Run time errors:occurs at illegal instructions in the code
Logical errors:occurs at when we give any wrong logic to the code

durgasyamalaperuri
Автор

Compile time error:-occurs between the compilation time, we also called as syntax error.
Run time error:- occurs between the running time of program or occurs between the execution of our program.
Logical error:- occurs when we are given wrong logic in our program means program. Executed and compiled but output won't given in proper manner.

sangam_Patil
Автор

Compile error- error occurs due to syntax
Runtime error -error occurs while the CPU didn't get output
Logic error -error occurs due to logics in operations

mohanprasath
Автор

"Compile time errors "are occurred at syntax mistakes on the c code.
"Run time errors "are occurred at illegal program instructions like missing semicolon etc
"Logical errors "are occurred at if we done any mistakes on the program logic it will occur.

bhanuprasannareddy
Автор

1.)Compile Time Error:
This error occurs during Compilation Process is due to not using right syntax in C Source Code.
Eg: printf("Hello World") .. without using Semicolon in the above line.

2.)Run Time Error:
This error occurs during Program Execution. Cpu unable to run the Program.

3.)Logical Time Error:
Problem in Program logic and you won't get a desired Output.

Thenmozhibca