Find out the error in following C program. 1. tinclude 2. 3. int main () 4. ( 5. int x = 3; 6. if (x = 4) 7. printf("x is equal to 4"); 8. else 9. 10. return 0; 11. } printf ("x is not equal to 4"); O A. 4 should be enclosed in quotations O B. There is no semicolon at the end of the first line oC. Equals to operator mistake O D. Variable x, should not be inside quotation.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter2: Basic Elements Of C++
Section: Chapter Questions
Problem 5PE
icon
Related questions
Question
Find out the error in following C program.
1. finclude <stdio.h>
2.
3. int main ()
4. {
5. int x = 3;
6. if (x = 4)
7.
printf("x is equal to 4");
8. else
9.
10. return 0;
11. }
printf ("x is not equal to 4");
O A. 4 should be enclosed in quotations
O B. There is no semicolon at the end of the first line
O C. Equals to operator mistake
O D. Variable x, should not be inside quotation.
Transcribed Image Text:Find out the error in following C program. 1. finclude <stdio.h> 2. 3. int main () 4. { 5. int x = 3; 6. if (x = 4) 7. printf("x is equal to 4"); 8. else 9. 10. return 0; 11. } printf ("x is not equal to 4"); O A. 4 should be enclosed in quotations O B. There is no semicolon at the end of the first line O C. Equals to operator mistake O D. Variable x, should not be inside quotation.
Based on the following FLOWCHART and tracing table,
START
N
SUM
N=0
SUM=0
A
A
B
B
IF
NO
N=N*5
N<5
SUM=SUM+N
D
D
I YES
N=N+2
SUM=SU M+N
PRINT
SUM, N
OUTPUT:
END
1) What is the value of N and SUM for part A ?:
O 1,1
O 2, 3
O 1,2
O 2, 2
2) What is the value of N and SUM for part B
?:
O 4,4
O 4, 6
O 2, 6
O 2, 4
3) What is the value of N and SUM for part C ?:
O 6, 12
O 5, 6
O 6, 8
O 6, 10
4) What is the value of N and SUM for part D ?:
O 15 22
O 25, 42
O 25, 32
O 30, 42
5) What is the OUTPUT for part E?:
O 22, 15
O 42, 25
O 32, 25
O 42, 30
Transcribed Image Text:Based on the following FLOWCHART and tracing table, START N SUM N=0 SUM=0 A A B B IF NO N=N*5 N<5 SUM=SUM+N D D I YES N=N+2 SUM=SU M+N PRINT SUM, N OUTPUT: END 1) What is the value of N and SUM for part A ?: O 1,1 O 2, 3 O 1,2 O 2, 2 2) What is the value of N and SUM for part B ?: O 4,4 O 4, 6 O 2, 6 O 2, 4 3) What is the value of N and SUM for part C ?: O 6, 12 O 5, 6 O 6, 8 O 6, 10 4) What is the value of N and SUM for part D ?: O 15 22 O 25, 42 O 25, 32 O 30, 42 5) What is the OUTPUT for part E?: O 22, 15 O 42, 25 O 32, 25 O 42, 30
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Structure chart
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