SlideShare a Scribd company logo
1 of 3
1.
void fun(int &j) {
j++;
}
int main() {
int i = 20;
fun(i);
printf("i = %d ", i);
return 0;
}
2.
void fun(int *j) {
(*j)++;
}
int main() {
int i = 20;
int *p = &i;
fun(p);
printf("i = %d ", i);
return 0;
}
3.
#include<stdio.h>
void square(int);
main() {
int num = 3;
square(num);
printf(“num: %d ―, num);
}
void square (int num) {
num = num * num;
}
4.
#include<stdio.h>
int square(int);
main() {
int num = 3;
square(num);
printf(“num: %d ―, num);
num = square(num);
printf(“num: %d ―, num);
}
int square (int num) {
num = num * num;
return num;
}
Solution
1)))))))))))))
the address of i is passed in the fuinction in this case
then in the function the address is incremented and print in the main block
2)))))))))))))))
p is a pointer as a pointer it stores the address of another variable
here p stores the address of variable i rather than the value of a variable
3))))))))))))))
function with arguement and no return type
the fun ction here declared as void so it doesnot return the value
4))))))))))
function with arguement and return type
it returns the value to the called function.
1- void fun(int &j) { j++- } int main() { int i - 20- fun(i)- printf(-.docx

More Related Content

Similar to 1- void fun(int &j) { j++- } int main() { int i - 20- fun(i)- printf(-.docx

Common problems solving using c
Common problems solving using cCommon problems solving using c
Common problems solving using cArghodeepPaul
 
8 arrays and pointers
8  arrays and pointers8  arrays and pointers
8 arrays and pointersMomenMostafa
 
#include stdio.h #include stdlib.h #include time.hdouble.pdf
#include stdio.h #include stdlib.h #include time.hdouble.pdf#include stdio.h #include stdlib.h #include time.hdouble.pdf
#include stdio.h #include stdlib.h #include time.hdouble.pdfarjunchetri1
 
c interview progs.pdf
c interview progs.pdfc interview progs.pdf
c interview progs.pdfpooja82042
 
C++ Programming - 2nd Study
C++ Programming - 2nd StudyC++ Programming - 2nd Study
C++ Programming - 2nd StudyChris Ohk
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given numberMainak Sasmal
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given numberMainak Sasmal
 
Slide set 6 Strings and pointers.pdf
Slide set 6 Strings and pointers.pdfSlide set 6 Strings and pointers.pdf
Slide set 6 Strings and pointers.pdfHimanshuKansal22
 
(Meta 5) ejemplo vectores dev c++
(Meta 5) ejemplo vectores dev c++ (Meta 5) ejemplo vectores dev c++
(Meta 5) ejemplo vectores dev c++ Eli Diaz
 
(Meta 5) ejemplo vectores 2 dev c++
(Meta 5) ejemplo vectores 2 dev c++ (Meta 5) ejemplo vectores 2 dev c++
(Meta 5) ejemplo vectores 2 dev c++ Eli Diaz
 
Implementing Virtual Machines in Go & C
Implementing Virtual Machines in Go & CImplementing Virtual Machines in Go & C
Implementing Virtual Machines in Go & CEleanor McHugh
 

Similar to 1- void fun(int &j) { j++- } int main() { int i - 20- fun(i)- printf(-.docx (20)

Common problems solving using c
Common problems solving using cCommon problems solving using c
Common problems solving using c
 
C Programs.pptx
C Programs.pptxC Programs.pptx
C Programs.pptx
 
Blocks+gcd入門
Blocks+gcd入門Blocks+gcd入門
Blocks+gcd入門
 
8 arrays and pointers
8  arrays and pointers8  arrays and pointers
8 arrays and pointers
 
#include stdio.h #include stdlib.h #include time.hdouble.pdf
#include stdio.h #include stdlib.h #include time.hdouble.pdf#include stdio.h #include stdlib.h #include time.hdouble.pdf
#include stdio.h #include stdlib.h #include time.hdouble.pdf
 
CSE240 Pointers
CSE240 PointersCSE240 Pointers
CSE240 Pointers
 
c interview progs.pdf
c interview progs.pdfc interview progs.pdf
c interview progs.pdf
 
Pointer example
Pointer examplePointer example
Pointer example
 
C programs
C programsC programs
C programs
 
C++ Programming - 2nd Study
C++ Programming - 2nd StudyC++ Programming - 2nd Study
C++ Programming - 2nd Study
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
 
Slide set 6 Strings and pointers.pdf
Slide set 6 Strings and pointers.pdfSlide set 6 Strings and pointers.pdf
Slide set 6 Strings and pointers.pdf
 
C lab programs
C lab programsC lab programs
C lab programs
 
C lab programs
C lab programsC lab programs
C lab programs
 
(Meta 5) ejemplo vectores dev c++
(Meta 5) ejemplo vectores dev c++ (Meta 5) ejemplo vectores dev c++
(Meta 5) ejemplo vectores dev c++
 
(Meta 5) ejemplo vectores 2 dev c++
(Meta 5) ejemplo vectores 2 dev c++ (Meta 5) ejemplo vectores 2 dev c++
(Meta 5) ejemplo vectores 2 dev c++
 
Implementing Virtual Machines in Go & C
Implementing Virtual Machines in Go & CImplementing Virtual Machines in Go & C
Implementing Virtual Machines in Go & C
 
Cpds lab
Cpds labCpds lab
Cpds lab
 
C programs pbq final
C programs pbq finalC programs pbq final
C programs pbq final
 

More from tjames442

A star is 17-2 ly (light-years) from Earth- HINT (a) At what constant.docx
A star is 17-2 ly (light-years) from Earth- HINT (a) At what constant.docxA star is 17-2 ly (light-years) from Earth- HINT (a) At what constant.docx
A star is 17-2 ly (light-years) from Earth- HINT (a) At what constant.docxtjames442
 
A true statement about atoms is that they can emit radiation at freque.docx
A true statement about atoms is that they can emit radiation at freque.docxA true statement about atoms is that they can emit radiation at freque.docx
A true statement about atoms is that they can emit radiation at freque.docxtjames442
 
A TDR price of a length of 60 centimeters was installed vertically int.docx
A TDR price of a length of 60 centimeters was installed vertically int.docxA TDR price of a length of 60 centimeters was installed vertically int.docx
A TDR price of a length of 60 centimeters was installed vertically int.docxtjames442
 
1- The real interest rate is defined as- A- inflation minus the nomina.docx
1- The real interest rate is defined as- A- inflation minus the nomina.docx1- The real interest rate is defined as- A- inflation minus the nomina.docx
1- The real interest rate is defined as- A- inflation minus the nomina.docxtjames442
 
1- The intNumbers array is a one dimensional array- Write the statemen.docx
1- The intNumbers array is a one dimensional array- Write the statemen.docx1- The intNumbers array is a one dimensional array- Write the statemen.docx
1- The intNumbers array is a one dimensional array- Write the statemen.docxtjames442
 
1- The following data were reported by a corporation- Authorized share.docx
1- The following data were reported by a corporation- Authorized share.docx1- The following data were reported by a corporation- Authorized share.docx
1- The following data were reported by a corporation- Authorized share.docxtjames442
 
1- The following change is physical or chemical- Explain why- Water bo.docx
1- The following change is physical or chemical- Explain why- Water bo.docx1- The following change is physical or chemical- Explain why- Water bo.docx
1- The following change is physical or chemical- Explain why- Water bo.docxtjames442
 
1- Which of the following is a situation in which an involuntary trans.docx
1- Which of the following is a situation in which an involuntary trans.docx1- Which of the following is a situation in which an involuntary trans.docx
1- Which of the following is a situation in which an involuntary trans.docxtjames442
 
1- Which of the following is NOT a function of a firewall- a- Blocks o.docx
1- Which of the following is NOT a function of a firewall- a- Blocks o.docx1- Which of the following is NOT a function of a firewall- a- Blocks o.docx
1- Which of the following is NOT a function of a firewall- a- Blocks o.docxtjames442
 
1- What soil characteristics influence compressibility 2- Why is conso.docx
1- What soil characteristics influence compressibility 2- Why is conso.docx1- What soil characteristics influence compressibility 2- Why is conso.docx
1- What soil characteristics influence compressibility 2- Why is conso.docxtjames442
 
1- What type of encryption does PKI use- Symmetric Asymmetric DES AES.docx
1- What type of encryption does PKI use- Symmetric Asymmetric DES AES.docx1- What type of encryption does PKI use- Symmetric Asymmetric DES AES.docx
1- What type of encryption does PKI use- Symmetric Asymmetric DES AES.docxtjames442
 
1- What kind of contract did Lulene and Ellen have- What kinds of issu.docx
1- What kind of contract did Lulene and Ellen have- What kinds of issu.docx1- What kind of contract did Lulene and Ellen have- What kinds of issu.docx
1- What kind of contract did Lulene and Ellen have- What kinds of issu.docxtjames442
 
1- what is the net ionic equation for the neutralization of HBr with K.docx
1- what is the net ionic equation for the neutralization of HBr with K.docx1- what is the net ionic equation for the neutralization of HBr with K.docx
1- what is the net ionic equation for the neutralization of HBr with K.docxtjames442
 
1- What is outsourcing- What are advantages and disadvantages of outso.docx
1- What is outsourcing- What are advantages and disadvantages of outso.docx1- What is outsourcing- What are advantages and disadvantages of outso.docx
1- What is outsourcing- What are advantages and disadvantages of outso.docxtjames442
 
1- What is the difference between OSI and TCP-IP layered models-Soluti.docx
1- What is the difference between OSI and TCP-IP layered models-Soluti.docx1- What is the difference between OSI and TCP-IP layered models-Soluti.docx
1- What is the difference between OSI and TCP-IP layered models-Soluti.docxtjames442
 
1- What is a database- Give some examples- 2- What is a database manag.docx
1- What is a database- Give some examples- 2- What is a database manag.docx1- What is a database- Give some examples- 2- What is a database manag.docx
1- What is a database- Give some examples- 2- What is a database manag.docxtjames442
 
1- What are the functional sources of power- 2- Distinguish between pe.docx
1- What are the functional sources of power- 2- Distinguish between pe.docx1- What are the functional sources of power- 2- Distinguish between pe.docx
1- What are the functional sources of power- 2- Distinguish between pe.docxtjames442
 
1- What are phonons- What information can be obtained by studying the.docx
1- What are phonons- What information can be obtained by studying the.docx1- What are phonons- What information can be obtained by studying the.docx
1- What are phonons- What information can be obtained by studying the.docxtjames442
 
1- Single convex lenses can be used to make images of far away objects.docx
1- Single convex lenses can be used to make images of far away objects.docx1- Single convex lenses can be used to make images of far away objects.docx
1- Single convex lenses can be used to make images of far away objects.docxtjames442
 
1- Materials are deep-seated in human culture- Do you agree with this.docx
1- Materials are deep-seated in human culture- Do you agree with this.docx1- Materials are deep-seated in human culture- Do you agree with this.docx
1- Materials are deep-seated in human culture- Do you agree with this.docxtjames442
 

More from tjames442 (20)

A star is 17-2 ly (light-years) from Earth- HINT (a) At what constant.docx
A star is 17-2 ly (light-years) from Earth- HINT (a) At what constant.docxA star is 17-2 ly (light-years) from Earth- HINT (a) At what constant.docx
A star is 17-2 ly (light-years) from Earth- HINT (a) At what constant.docx
 
A true statement about atoms is that they can emit radiation at freque.docx
A true statement about atoms is that they can emit radiation at freque.docxA true statement about atoms is that they can emit radiation at freque.docx
A true statement about atoms is that they can emit radiation at freque.docx
 
A TDR price of a length of 60 centimeters was installed vertically int.docx
A TDR price of a length of 60 centimeters was installed vertically int.docxA TDR price of a length of 60 centimeters was installed vertically int.docx
A TDR price of a length of 60 centimeters was installed vertically int.docx
 
1- The real interest rate is defined as- A- inflation minus the nomina.docx
1- The real interest rate is defined as- A- inflation minus the nomina.docx1- The real interest rate is defined as- A- inflation minus the nomina.docx
1- The real interest rate is defined as- A- inflation minus the nomina.docx
 
1- The intNumbers array is a one dimensional array- Write the statemen.docx
1- The intNumbers array is a one dimensional array- Write the statemen.docx1- The intNumbers array is a one dimensional array- Write the statemen.docx
1- The intNumbers array is a one dimensional array- Write the statemen.docx
 
1- The following data were reported by a corporation- Authorized share.docx
1- The following data were reported by a corporation- Authorized share.docx1- The following data were reported by a corporation- Authorized share.docx
1- The following data were reported by a corporation- Authorized share.docx
 
1- The following change is physical or chemical- Explain why- Water bo.docx
1- The following change is physical or chemical- Explain why- Water bo.docx1- The following change is physical or chemical- Explain why- Water bo.docx
1- The following change is physical or chemical- Explain why- Water bo.docx
 
1- Which of the following is a situation in which an involuntary trans.docx
1- Which of the following is a situation in which an involuntary trans.docx1- Which of the following is a situation in which an involuntary trans.docx
1- Which of the following is a situation in which an involuntary trans.docx
 
1- Which of the following is NOT a function of a firewall- a- Blocks o.docx
1- Which of the following is NOT a function of a firewall- a- Blocks o.docx1- Which of the following is NOT a function of a firewall- a- Blocks o.docx
1- Which of the following is NOT a function of a firewall- a- Blocks o.docx
 
1- What soil characteristics influence compressibility 2- Why is conso.docx
1- What soil characteristics influence compressibility 2- Why is conso.docx1- What soil characteristics influence compressibility 2- Why is conso.docx
1- What soil characteristics influence compressibility 2- Why is conso.docx
 
1- What type of encryption does PKI use- Symmetric Asymmetric DES AES.docx
1- What type of encryption does PKI use- Symmetric Asymmetric DES AES.docx1- What type of encryption does PKI use- Symmetric Asymmetric DES AES.docx
1- What type of encryption does PKI use- Symmetric Asymmetric DES AES.docx
 
1- What kind of contract did Lulene and Ellen have- What kinds of issu.docx
1- What kind of contract did Lulene and Ellen have- What kinds of issu.docx1- What kind of contract did Lulene and Ellen have- What kinds of issu.docx
1- What kind of contract did Lulene and Ellen have- What kinds of issu.docx
 
1- what is the net ionic equation for the neutralization of HBr with K.docx
1- what is the net ionic equation for the neutralization of HBr with K.docx1- what is the net ionic equation for the neutralization of HBr with K.docx
1- what is the net ionic equation for the neutralization of HBr with K.docx
 
1- What is outsourcing- What are advantages and disadvantages of outso.docx
1- What is outsourcing- What are advantages and disadvantages of outso.docx1- What is outsourcing- What are advantages and disadvantages of outso.docx
1- What is outsourcing- What are advantages and disadvantages of outso.docx
 
1- What is the difference between OSI and TCP-IP layered models-Soluti.docx
1- What is the difference between OSI and TCP-IP layered models-Soluti.docx1- What is the difference between OSI and TCP-IP layered models-Soluti.docx
1- What is the difference between OSI and TCP-IP layered models-Soluti.docx
 
1- What is a database- Give some examples- 2- What is a database manag.docx
1- What is a database- Give some examples- 2- What is a database manag.docx1- What is a database- Give some examples- 2- What is a database manag.docx
1- What is a database- Give some examples- 2- What is a database manag.docx
 
1- What are the functional sources of power- 2- Distinguish between pe.docx
1- What are the functional sources of power- 2- Distinguish between pe.docx1- What are the functional sources of power- 2- Distinguish between pe.docx
1- What are the functional sources of power- 2- Distinguish between pe.docx
 
1- What are phonons- What information can be obtained by studying the.docx
1- What are phonons- What information can be obtained by studying the.docx1- What are phonons- What information can be obtained by studying the.docx
1- What are phonons- What information can be obtained by studying the.docx
 
1- Single convex lenses can be used to make images of far away objects.docx
1- Single convex lenses can be used to make images of far away objects.docx1- Single convex lenses can be used to make images of far away objects.docx
1- Single convex lenses can be used to make images of far away objects.docx
 
1- Materials are deep-seated in human culture- Do you agree with this.docx
1- Materials are deep-seated in human culture- Do you agree with this.docx1- Materials are deep-seated in human culture- Do you agree with this.docx
1- Materials are deep-seated in human culture- Do you agree with this.docx
 

Recently uploaded

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
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
 
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
 
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
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 

Recently uploaded (20)

TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
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
 
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
 
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
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 

1- void fun(int &j) { j++- } int main() { int i - 20- fun(i)- printf(-.docx

  • 1. 1. void fun(int &j) { j++; } int main() { int i = 20; fun(i); printf("i = %d ", i); return 0; } 2. void fun(int *j) { (*j)++; } int main() { int i = 20; int *p = &i; fun(p); printf("i = %d ", i); return 0; } 3. #include<stdio.h> void square(int); main() { int num = 3; square(num); printf(“num: %d ―, num); } void square (int num) { num = num * num; } 4. #include<stdio.h> int square(int); main() { int num = 3; square(num); printf(“num: %d ―, num); num = square(num); printf(“num: %d ―, num); } int square (int num) { num = num * num; return num; }
  • 2. Solution 1))))))))))))) the address of i is passed in the fuinction in this case then in the function the address is incremented and print in the main block 2))))))))))))))) p is a pointer as a pointer it stores the address of another variable here p stores the address of variable i rather than the value of a variable 3)))))))))))))) function with arguement and no return type the fun ction here declared as void so it doesnot return the value 4)))))))))) function with arguement and return type it returns the value to the called function.