In C programming language

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 30PE
icon
Related questions
Question

In C programming language

Find the error in each of the following. (Note: There may be more than one error.)
a) for (a = 25, a <= 1, a--); {
printf("%d\n", a); }
b) The following code should print whether a given integer is odd or even:
switch (value) {
case (value % 2 == 0):
puts("Even integer");
case (value % 2 != 0):
puts("Odd integer"); }
2.
Transcribed Image Text:Find the error in each of the following. (Note: There may be more than one error.) a) for (a = 25, a <= 1, a--); { printf("%d\n", a); } b) The following code should print whether a given integer is odd or even: switch (value) { case (value % 2 == 0): puts("Even integer"); case (value % 2 != 0): puts("Odd integer"); } 2.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning