Home
10th Grade
11th And 12th
11th Grade
12th Grade
3rd Grade
4th Grade
5th Grade
6th Grade
7th Grade
8th Grade
9th Grade
Advance Accountancy
Auditing
Computer Aptitude
Direct And Indirect Taxation
Exams
General Hindi
Indian Finance System
Information Technology And Application In Business
Macro Economics
Town Planning
Aerospace And Aeronautical
Analytical Instrumentation
Banking Awareness
Banking Exam
Biochemistry
Bioinformatics
Biology
Biotechnology
Business Statistics
C Program
C Programming
C++ Programming
Career Aptitude Test
Cell Biology
Central Superior Service (css)
Chemical Engineering
Chemistry
Civil Engineering
Commerce
Computer
Computer Fundamentals
Computer Science
Cost Accounting
Css
Database
Drug And Pharmaceutical Biotechnology
Ecat And Mcat Entry Test
Economics
Electrical Engineering
Electrical Engineering Questions
Electrical Measurement And Instrumentation
Engineering
English
English Literature
Environment Management
Environmental Biotechnology
Enzyme Technology
Financial Management And Financial Markets
Gate
General Knowledge
Graduate Assessment Test (gat)
Health And Physical
Heat Transfer
Html
Human Anatomy And Physiology
Human And Cultural Diversity
Human Resource Management
Ias
Indian Economy
Indian Economy
Indian General Awareness
Indian Geography
Indian Geography
Indian History
Indian History
Indian Polity
Instrumentation Transducers
International Relations
Java Program
Javascript
Judiciary And Law
Life Sciences
Management
Marketing And Marketing Management
Mass Transfer
Mechanical Engineering
Mechanics Of Materials
Medical Subjects
Microbiology
Networking
Php
Placement Tests
Professional Communication
Quantitative Aptitude
Reasoning Aptitude
Renewable Energy
Science
Sociology
Sql
Surveying
Total Quality Management
Uidai Aadhaar Supervisor Certification
Virology
Notificatin
Exam
Blog
Contact Us
Pointer(Computer Science > C Program ) Questions and Answers
Home
Topic
Computer Science
C Program
Pointer
Question 1.
Determine Output:
void main()
{
char far *farther, *farthest;
printf("%d..%d", sizeof(farther), sizeof(farthest));
}
4..2
2..2
4..4
2..4
Explanation:-
Answer: Option A. ->
4..2
Question 2.
Determine Output:
main()
{
char *str1 = "abcd";
char str2[] = "abcd";
printf("%d %d %d", sizeof(str1), sizeof(str2), sizeof("abcd"));
}
2 5 5
2 4 4
8 5 5
2 4 5
Explanation:-
Answer: Option C. ->
8 5 5
Question 3.
Choose the best answer.
Prior to using a pointer variable
It should be declared.
It should be initialized.
It should be both declared and initialized.
None of these.
Explanation:-
Answer: Option C. ->
It should be both declared and initialized.
Question 4.
Comment on the following pointer declaration?
int *ptr, p;
ptr is a pointer to integer, p is not.
ptr and p, both are pointers to integer.
ptr is pointer to integer, p may or may not be.
ptr and p both are not pointers to integer.
Explanation:-
Answer: Option A. ->
ptr is a pointer to integer, p is not.
Question 5.
What will be the output?
main()
{
char *p;
p = "Hello";
printf("%cn",*&*p);
}
Hello
H
Some address will be printed
None of these.
Explanation:-
Answer: Option B. ->
H
Question 6.
Determine output:
#include
void main()
{
char *p = NULL;
char *q = 0;
if(p)
printf(" p ");
else
printf("nullp");
if(q)
printf("q");
else
printf(" nullq");
}
p q
Depends on the compiler
x nullq where x can be p or nullp depending on the value of NULL
nullp nullq
Explanation:-
Answer: Option D. ->
nullp nullq
Question 7.
The address operator &, cannot act on
R-values
Arithmetic expressions
Both of the above
Local variables
Members of a structure
Explanation:-
Answer: Option C. ->
Both of the above
Question 8.
The statement
int **a;
is illegal
is legal but meaningless
is syntactically and semantically correct
None of these.
Explanation:-
Answer: Option C. ->
is syntactically and semantically correct
Question 9.
What will be the output of the following program code?
#include
void main()
{
int i = 10;
void *p = &i;
printf("%f", *(float *)p);
}
Error
10
0.000000
None of these.
Explanation:-
Answer: Option C. ->
0.000000
Question 10.
What will be the output of the following program?
#include
void main()
{
int i = 10;
void *p = &i;
printf("%d\n", (int)*p);
}
Compiler time error
Segmentation fault/runtime crash
10
Undefined behavior
Explanation:-
Answer: Option A. ->
Compiler time error
1
2
3
Next →
One click Login
Login With Google
Old way of Login
Login With Email