SlideShare a Scribd company logo
1 of 4
POINTERS IN C
PRACTICE QUESTIONS
Q1.
int main()
{
int m=25;
int *p=m;
printf("%d",*p);
}
a. 25
b. Address of m
c. Compilation Error
d. None of These
Q2.
int main()
{
int m=25;
int *p=&m;
printf("%d",*p);
getch();
}
a. 25
b. Address of m
c. Compilation Error
d. None of These
Q3.
int main()
{
int *p,m=25;
p=&m;
printf("%d",*p);
getch();
}
a. 25
b. Address of m
c. Compilation Error
d. None of These
Q4
int main()
{
int *p=25;
printf("%d",*p);
getch();
}
a. 25
b. Address of m
c. Compilation Error
d. None of These
Q5.
int main()
{
int x,*p,y=9;
x=10;
p=&x;
y=*p;
*p=20;
printf("%d",x);
getch();
}
a. 10
b. 9
c. 20
d. None Of These
Q6
int main()
{
float *p=NULL;
printf("%d",*p);
getch();
}
a. 0
b. 1
c. Compile Time Error
d. Blank Output
Q7.
int main()
{
int x=8,y=10,z=5;
int *p;
p=&x,&y,&z;
printf("%d",*p);
getch();
}
a. 8
b. 10
c. 5
d. Compile Time Error
Q8.
int main()
{
int x=8,y=10,z=5;
int *p;
p=(&x,&y,&z);
printf("%d",*p);
getch();
}
a. 8
b. 10
c. 5
d. Compile Time Error
Q9.
int main()
{
int x=10,y;
int *w=&x;
y=*w;
*w=20;
printf("%d %d %d",x,y,*w);
getch();
}
a. 20 10 20
b. 10 10 20
c. 20 20 20
d. 10 20 20
Q10
int main()
{
int x=10,y=20,sum;
int *z1=&x;
int *z2=&y;
sum=5* - *z2 /*z1;
printf("%d ",sum);
getch();
}
a. -10
b. 10
c. 3
d. Compile Time Error
Q11.
int main()
{
int x=10,y=20,sum;
int *z1=&x;
int *z2=&y;
printf("%d",*z1>*z2);
getch();
}
a. 0
b. 1
c. 10
d. 20
ANSWERS:
1. C 2. A 3. A 4. C 5. C
6. D 7. A 8. C 9. A 10. D
11. A
For more assistance please visit:: http://codingprograms.wordpress.com/

More Related Content

What's hot

Exception handling c++
Exception handling c++Exception handling c++
Exception handling c++Jayant Dalvi
 
90963869 latihan-soal-struktur-data-semester2
90963869 latihan-soal-struktur-data-semester290963869 latihan-soal-struktur-data-semester2
90963869 latihan-soal-struktur-data-semester2Saybia Himma
 
C Recursion, Pointers, Dynamic memory management
C Recursion, Pointers, Dynamic memory managementC Recursion, Pointers, Dynamic memory management
C Recursion, Pointers, Dynamic memory managementSreedhar Chowdam
 
OOM MCQ 2018
OOM  MCQ 2018OOM  MCQ 2018
OOM MCQ 2018lochan100
 
Introduction to c++
Introduction to c++Introduction to c++
Introduction to c++somu rajesh
 
Struktur dasar algoritma
Struktur dasar algoritmaStruktur dasar algoritma
Struktur dasar algoritmaMAFauzan
 
Quiz UAS Struktur Data
Quiz UAS Struktur DataQuiz UAS Struktur Data
Quiz UAS Struktur Datasansyarif
 
Dynamic Adaptive Streaming over HTTP: From Content Creation to Consumption
Dynamic Adaptive Streaming over HTTP: From Content Creation to ConsumptionDynamic Adaptive Streaming over HTTP: From Content Creation to Consumption
Dynamic Adaptive Streaming over HTTP: From Content Creation to ConsumptionAlpen-Adria-Universität
 
Templates in C++
Templates in C++Templates in C++
Templates in C++Tech_MX
 
Standard Template Library
Standard Template LibraryStandard Template Library
Standard Template LibraryGauravPatil318
 
introduction to trees,graphs,hashing
introduction to trees,graphs,hashingintroduction to trees,graphs,hashing
introduction to trees,graphs,hashingAkhil Prem
 
Chapter 5 Balagurusamy Programming ANSI in c
Chapter 5 Balagurusamy Programming ANSI  in cChapter 5 Balagurusamy Programming ANSI  in c
Chapter 5 Balagurusamy Programming ANSI in cBUBT
 
Operator Overloading
Operator OverloadingOperator Overloading
Operator OverloadingNilesh Dalvi
 

What's hot (20)

Function C++
Function C++ Function C++
Function C++
 
Exception handling c++
Exception handling c++Exception handling c++
Exception handling c++
 
90963869 latihan-soal-struktur-data-semester2
90963869 latihan-soal-struktur-data-semester290963869 latihan-soal-struktur-data-semester2
90963869 latihan-soal-struktur-data-semester2
 
C Recursion, Pointers, Dynamic memory management
C Recursion, Pointers, Dynamic memory managementC Recursion, Pointers, Dynamic memory management
C Recursion, Pointers, Dynamic memory management
 
OOM MCQ 2018
OOM  MCQ 2018OOM  MCQ 2018
OOM MCQ 2018
 
Getting Started with C++
Getting Started with C++Getting Started with C++
Getting Started with C++
 
Introduction to c++
Introduction to c++Introduction to c++
Introduction to c++
 
Struktur dasar algoritma
Struktur dasar algoritmaStruktur dasar algoritma
Struktur dasar algoritma
 
VTU Data Structures Lab Manual
VTU Data Structures Lab ManualVTU Data Structures Lab Manual
VTU Data Structures Lab Manual
 
Quiz UAS Struktur Data
Quiz UAS Struktur DataQuiz UAS Struktur Data
Quiz UAS Struktur Data
 
Dynamic Adaptive Streaming over HTTP: From Content Creation to Consumption
Dynamic Adaptive Streaming over HTTP: From Content Creation to ConsumptionDynamic Adaptive Streaming over HTTP: From Content Creation to Consumption
Dynamic Adaptive Streaming over HTTP: From Content Creation to Consumption
 
Templates in C++
Templates in C++Templates in C++
Templates in C++
 
Standard Template Library
Standard Template LibraryStandard Template Library
Standard Template Library
 
introduction to trees,graphs,hashing
introduction to trees,graphs,hashingintroduction to trees,graphs,hashing
introduction to trees,graphs,hashing
 
Graph algorithm
Graph algorithmGraph algorithm
Graph algorithm
 
Chapter 5 Balagurusamy Programming ANSI in c
Chapter 5 Balagurusamy Programming ANSI  in cChapter 5 Balagurusamy Programming ANSI  in c
Chapter 5 Balagurusamy Programming ANSI in c
 
Unit 3. Input and Output
Unit 3. Input and OutputUnit 3. Input and Output
Unit 3. Input and Output
 
Structure & union
Structure & unionStructure & union
Structure & union
 
Operator Overloading
Operator OverloadingOperator Overloading
Operator Overloading
 
Latihan soal struktur data
Latihan soal struktur dataLatihan soal struktur data
Latihan soal struktur data
 

Similar to MCQs(MULTIPLE CHOICE QUESTIONS) POINTERS C

Technical questions for interview c programming
Technical questions for interview  c programmingTechnical questions for interview  c programming
Technical questions for interview c programmingCHANDAN KUMAR
 
C - programming - Ankit Kumar Singh
C - programming - Ankit Kumar Singh C - programming - Ankit Kumar Singh
C - programming - Ankit Kumar Singh AnkitSinghRajput35
 
C tech questions
C tech questionsC tech questions
C tech questionsvijay00791
 
Chapter 8 c solution
Chapter 8 c solutionChapter 8 c solution
Chapter 8 c solutionAzhar Javed
 
Dti2143 chapter 3 arithmatic relation-logicalexpression
Dti2143 chapter 3 arithmatic relation-logicalexpressionDti2143 chapter 3 arithmatic relation-logicalexpression
Dti2143 chapter 3 arithmatic relation-logicalexpressionalish sha
 
Simple C programs
Simple C programsSimple C programs
Simple C programsab11cs001
 

Similar to MCQs(MULTIPLE CHOICE QUESTIONS) POINTERS C (9)

Technical questions for interview c programming
Technical questions for interview  c programmingTechnical questions for interview  c programming
Technical questions for interview c programming
 
Vcs4
Vcs4Vcs4
Vcs4
 
C - programming - Ankit Kumar Singh
C - programming - Ankit Kumar Singh C - programming - Ankit Kumar Singh
C - programming - Ankit Kumar Singh
 
C tech questions
C tech questionsC tech questions
C tech questions
 
Chapter 8 c solution
Chapter 8 c solutionChapter 8 c solution
Chapter 8 c solution
 
Dti2143 chapter 3 arithmatic relation-logicalexpression
Dti2143 chapter 3 arithmatic relation-logicalexpressionDti2143 chapter 3 arithmatic relation-logicalexpression
Dti2143 chapter 3 arithmatic relation-logicalexpression
 
Pointer basics
Pointer basicsPointer basics
Pointer basics
 
Simple C programs
Simple C programsSimple C programs
Simple C programs
 
ppt1s.pptx
ppt1s.pptxppt1s.pptx
ppt1s.pptx
 

Recently uploaded

18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 

Recently uploaded (20)

18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 

MCQs(MULTIPLE CHOICE QUESTIONS) POINTERS C

  • 1. POINTERS IN C PRACTICE QUESTIONS Q1. int main() { int m=25; int *p=m; printf("%d",*p); } a. 25 b. Address of m c. Compilation Error d. None of These Q2. int main() { int m=25; int *p=&m; printf("%d",*p); getch(); } a. 25 b. Address of m c. Compilation Error d. None of These Q3. int main() { int *p,m=25; p=&m; printf("%d",*p); getch(); }
  • 2. a. 25 b. Address of m c. Compilation Error d. None of These Q4 int main() { int *p=25; printf("%d",*p); getch(); } a. 25 b. Address of m c. Compilation Error d. None of These Q5. int main() { int x,*p,y=9; x=10; p=&x; y=*p; *p=20; printf("%d",x); getch(); } a. 10 b. 9 c. 20 d. None Of These Q6 int main() { float *p=NULL; printf("%d",*p); getch(); } a. 0
  • 3. b. 1 c. Compile Time Error d. Blank Output Q7. int main() { int x=8,y=10,z=5; int *p; p=&x,&y,&z; printf("%d",*p); getch(); } a. 8 b. 10 c. 5 d. Compile Time Error Q8. int main() { int x=8,y=10,z=5; int *p; p=(&x,&y,&z); printf("%d",*p); getch(); } a. 8 b. 10 c. 5 d. Compile Time Error Q9. int main() { int x=10,y; int *w=&x; y=*w; *w=20; printf("%d %d %d",x,y,*w); getch(); }
  • 4. a. 20 10 20 b. 10 10 20 c. 20 20 20 d. 10 20 20 Q10 int main() { int x=10,y=20,sum; int *z1=&x; int *z2=&y; sum=5* - *z2 /*z1; printf("%d ",sum); getch(); } a. -10 b. 10 c. 3 d. Compile Time Error Q11. int main() { int x=10,y=20,sum; int *z1=&x; int *z2=&y; printf("%d",*z1>*z2); getch(); } a. 0 b. 1 c. 10 d. 20 ANSWERS: 1. C 2. A 3. A 4. C 5. C 6. D 7. A 8. C 9. A 10. D 11. A For more assistance please visit:: http://codingprograms.wordpress.com/