Can you please explain the difference between syntax vs logical error?



Can you please explain the difference between syntax vs logical error?..

Answer / Rajat Kumar Tyagi

A syntax error is a mistake in the structure or formatting of your code that prevents it from being parsed correctly by the compiler. A logical error, on the other hand, occurs when your program runs but produces incorrect results due to errors in the logic or flow control.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

What does the && operator do in a program code?

1 Answers  


write a C program : To find out the number of identical words in two files . the file name should be taken as command line argument .

1 Answers   Subex,


Find the middle node in the linked list?? (Note:Do not use for loop, count and count/2)

6 Answers   Subex,


what is the disadvantage of using macros?

1 Answers   Wipro,


main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }

1 Answers   Wilco,


Find greatest of two numbers using macro

4 Answers   Bosch, Siemens,


Explain how can I convert a string to a number?

1 Answers  


Does sprintf put null character?

1 Answers  


What will be printed as the result of the operation below: #include<..> int x; int modifyvalue() { return(x+=10); } int changevalue(int x) { return(x+=1); } void main() { int x=10; x++; changevalue(x); x++; modifyvalue(); printf("First output:%d\n",x); x++; changevalue(x); printf("Second output:%d\n",x); modifyvalue(); printf("Third output:%d\n",x); }

2 Answers  


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

0 Answers   L&T,


write a c program that prints all multiples of 3between 1 and 50.

5 Answers  


what is pointer

1 Answers   TCS,


Categories