Point out the error line in the following program.1. #include<stdio.h>2. struct emp3. {4. char name[20];5. int age;6. };7. int main()8. {9. emp int xx;10. int a;11. printf("%d\n", a);12. return 0;13. }Select one:Line number 7Line number 9Line number 4None of these.
Question
Point out the error line in the following program.1. #include<stdio.h>2. struct emp3. {4. char name[20];5. int age;6. };7. int main()8. {9. emp int xx;10. int a;11. printf("%d\n", a);12. return 0;13. }Select one:Line number 7Line number 9Line number 4None of these.
Solution
The error is in line number 9. The correct syntax to declare a variable 'xx' of type 'emp' should be 'emp xx;', not 'emp int xx;'. So, the correct answer is Line number 9.
Similar Questions
When the following code is executed an error is encountered and the program crashes. On which line do you think the error is encountered?You may assume that all required classes have been defined elsewhere.
When a program runs, but does not do what you expect, it means that your progam contains…?Logical ErrorSyntax error
Point out the error line in the following program.1 #include <iostream>2 using namespace std;3 void main()4 {5 long int num = 10; 6 long int *ptr; 7 cout<<"num's address :"<< &num<<"\n"; 8 ptr = #9 cout<<"pointer's address :"<< &ptr<<"\n"; 10 cout<<"pointer's size bytes "<< sizeof(ptr)<<"\n"; 11 cout<<"pointer's value: "<< ptr<<"\n"; 12 cout<<"value pointed to: "<< *ptr<<"\n"; 13 return 0;14 }Select one:Line number 5Line number 12Line number 3Line number 10
What will be the output of the C program? ACompilation errorB1C5DRuntime error
What is an error that occurs during the execution of code?1 pointError messagesExceptionException handlingFinally
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.