Q2. Find the errors in each of the following code segments and correct it 1. #define Pl=3.14; 2. Assume int A[6]= (0), 1; for(i=1; i >= 6; i++) A[i] = A[i]*2; 3. char A[9]= "Technology"; 4. Assume char st[SIZE]="Hello"; //print all the values printf("%c", st[i]);

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section: Chapter Questions
Problem 8PP: (Data processing) A bank’s customer records are to be stored in a file and read into a set of arrays...
icon
Related questions
Question
Q2. Find the errors in each of the following code segments and correct it:
1. #define Pl=3.14;
2. Assume int A[6] = {0}, i;
for(i=1;i>= 6; i++)
A[i] = A[i]*2;
3. char A[9]= "Technology";
4. Assume char st[SIZE]="Hello";
//print all the values
printf("%c", st[i]);
(4x0.5=2 points)
Transcribed Image Text:Q2. Find the errors in each of the following code segments and correct it: 1. #define Pl=3.14; 2. Assume int A[6] = {0}, i; for(i=1;i>= 6; i++) A[i] = A[i]*2; 3. char A[9]= "Technology"; 4. Assume char st[SIZE]="Hello"; //print all the values printf("%c", st[i]); (4x0.5=2 points)
Expert Solution
steps

Step by step

Solved in 3 steps with 5 images

Blurred answer
Knowledge Booster
Program on Numbers
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++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
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