Give other kinds (beyond those illustrated in the previous question) of C/C++ st
ID: 3910501 • Letter: G
Question
Give other kinds (beyond those illustrated in the previous question) of C/C++ statements that are syntactically valid but whose meaning can not be reasonably defined in the semantics of a programming language.
Previous Question for reference: Consider the following sequence of C/C++ statements, which are syntactically valid but have no reasonable semantic interpretation (assuming that i andj have been declared as i nt variables):
j = 0;
i = 3 / j;
for (i =1; i > -1; i++)
i--;
How are these situations handled when executed by your C/C++ system?
Explanation / Answer
In C++ it will throw floatingpoint exception , in C language program will terminate abnormally
coming to the for loop that is purely programmer mistake it leads to infinite loop. C/C++ or anyother language can't do much on this scenario
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.