What is the essential difference between a failure and a fault? Give two of your own examples.
Fault is a wrong data definition, step or a process, that will make the program or software not produce the desired output. Fault can be occurred due to carelessness or wrong assumption . Fault may cause to failure.
One simple example of fault is :
consider the program
#include <stdio.h>
int main()
{
int hour1=2,hour2=2,minute1=15,minute2=15;
if(hour1==hour2)
{
printf("The time are same\n");
}
else
{
printf("Time not same\n");
}
return 0;
}
The program to check if two time are same or not. When the above program is executed, we will get the output as "time is same". When we change one of the minutes value, then also it will show "time is same". It s because here only checking hour is same. we have to check if both hour and minutes are same to print time is same.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps