Execution Errors(Real roots of Quadratic equation)
This is the very short and easy “C” coding that is used Execution Errors Statement.“printf” is the name of one of the main C output functions, and stands for “print formatted”.”scanf” is the name of one of the main C Input function, and stands for “Input formatted”.
Correct Program
Result
Wrong Program
“;”
This is the very important part of any programming language because “;” helps to stop the program limits if you don’t write “;” in your program statement the programming will be wrong.
#include<stdio.h>
#include<stdio. h> is a statement that tells the compiler to insert the contents of stdio.h at that particular place.
stdio. h is the header file for standard input and output.
printf
In C programming language, printf() function is used to print the “character, string, float, integer, octal and hexadecimal values” onto the output screen. We use printf() function with a %d format specifier to display the value of an integer variable.
void main()
The return type of the function “main” is void, i.e. it does not return anything to the OS. “void” means that you’re not allowed to pass any argument to the main.
{}
The symbols { }, used especially in mathematics and computer programs for showing that things written between them should be considered together.
scanf
In the C programming language, a scanf is a function that reads formatted data from stdin (i.e, the standard input stream, which is usually the keyboard, unless redirected) and then writes the results into the arguments given.
Error Statement and Write statement logic
“z=x*i+y*i ” is the wrong Equation which Makes the Program Execution Error. Here, When we match the Input statement and print command then the Result is Absolute.
You may also like: Debugging a Program
Leave a Reply