system.Out.Println("max of" + a + and + b + "is" +max); are find arrer
Answers
Any obstruction or mistake in the coding that stops the execution of the program is an error.
◼
The errors caused due to any gramitical mistake done by user while writing coding of the program are called syntax error.
Example :- Missing of semicolon or double qoutes.
◼
The error present in the logic of program, are known as logical errors.
Example :- If the user want to print even number and he did logic
for(i=1 ; i<=10 ;i+=2)
System. out. println(i);
It will print all odd numbers from 1 -10 ,while user wants even numbers.
So, coding should be,
for(i=0 ; i<=10 ;i+=2)
System. out. println(i);
◼
After the syntax error and logic error are removed , there are errors that appears during execution of program they are known as run time error.
Example :- Dividing a number by zero will give an infinite value.
sys tem . Out . Println("max of" +a+ and + b+"is" +max);
In the following segment of program ,there is
Because,
▶sys tem . out . println should be written as
▶The text written in brackets should be
So, the coding should be,
Answer:
\huge \bold{ERROR}ERROR
Any obstruction or mistake in the coding that stops the execution of the program is an error.
\huge \bold{TYPES \: OF \:ERROR}TYPESOFERROR
◼\bold{Syntax \: error}Syntaxerror
The errors caused due to any gramitical mistake done by user while writing coding of the program are called syntax error.
Example :- Missing of semicolon or double qoutes.
◼\bold{Logical \: error}Logicalerror
The error present in the logic of program, are known as logical errors.
Example :- If the user want to print even number and he did logic
for(i=1 ; i<=10 ;i+=2)
System. out. println(i);
It will print all odd numbers from 1 -10 ,while user wants even numbers.
So, coding should be,
for(i=0 ; i<=10 ;i+=2)
System. out. println(i);
◼\bold{Run \: time\: error}Runtimeerror
After the syntax error and logic error are removed , there are errors that appears during execution of program they are known as run time error.
Example :- Dividing a number by zero will give an infinite value.
\bold{IN \: THE \: QUESTION }INTHEQUESTION
sys tem . Out . Println("max of" +a+ and + b+"is" +max);
In the following segment of program ,there is \bold{SYNTAX \: ERROR}SYNTAXERROR
Bcoz. ,
▶sys tem . out . println should be written as \bold{System \: . \: out\: . \: println}System.out.println
▶The text written in brackets should be
\bold{"max \: of" +a+"and" +b+"is"+max}"maxof"+a+"and"+b+"is"+max
So, the coding should be,
\boxed{\bold{System \: . \: out\: . \: println("max \: of" +a+"and" +b+"is"+max)}}
System.out.println("maxof"+a+"and"+b+"is"+max)
Step-by-step explanation:
thx