SlideShare a Scribd company logo
C programming
Create a program to find the largest element of an array using pointers
Create an array int num[] = {50, 14, 25, 68, 78, 3}
Assign the first element of the array to a largest variable using pointer (int large - *num)
Use a loop to access each element of the array
Compare the large number with each array element using pointer
large < *(num+i)
If value in large variable is smaller than element, assign the array value to large as large = *(num
+ i)

More Related Content

More from NIRMALJAI08

C++ Deviation from Average (Recursion) Instructions Step 1- Write a.pdf
C++ Deviation from Average (Recursion)   Instructions Step 1- Write a.pdfC++ Deviation from Average (Recursion)   Instructions Step 1- Write a.pdf
C++ Deviation from Average (Recursion) Instructions Step 1- Write a.pdf
NIRMALJAI08
 

More from NIRMALJAI08 (20)

Caitlyn Communications reported the following figures from its adjuste.pdf
Caitlyn Communications reported the following figures from its adjuste.pdfCaitlyn Communications reported the following figures from its adjuste.pdf
Caitlyn Communications reported the following figures from its adjuste.pdf
 
C-CB+2A.pdf
C-CB+2A.pdfC-CB+2A.pdf
C-CB+2A.pdf
 
c- What is the probability that Z is between 1-51 and 1-81- The probab.pdf
c- What is the probability that Z is between 1-51 and 1-81- The probab.pdfc- What is the probability that Z is between 1-51 and 1-81- The probab.pdf
c- What is the probability that Z is between 1-51 and 1-81- The probab.pdf
 
C- Vitamin D is required for the absorption and deposition of calcium.pdf
C- Vitamin D is required for the absorption and deposition of calcium.pdfC- Vitamin D is required for the absorption and deposition of calcium.pdf
C- Vitamin D is required for the absorption and deposition of calcium.pdf
 
c- The login program will disallow logins of any students who enter th.pdf
c- The login program will disallow logins of any students who enter th.pdfc- The login program will disallow logins of any students who enter th.pdf
c- The login program will disallow logins of any students who enter th.pdf
 
C- Quantity Theory of Money In the country of Wiknam- assume that V is.pdf
C- Quantity Theory of Money In the country of Wiknam- assume that V is.pdfC- Quantity Theory of Money In the country of Wiknam- assume that V is.pdf
C- Quantity Theory of Money In the country of Wiknam- assume that V is.pdf
 
C- Picea mariana (black spruce) atsk This specimen was collected trom.pdf
C- Picea mariana (black spruce) atsk This specimen was collected trom.pdfC- Picea mariana (black spruce) atsk This specimen was collected trom.pdf
C- Picea mariana (black spruce) atsk This specimen was collected trom.pdf
 
c) Lefp and q be the pixels at coordinates (10-15) and (15-25) respect.pdf
c) Lefp and q be the pixels at coordinates (10-15) and (15-25) respect.pdfc) Lefp and q be the pixels at coordinates (10-15) and (15-25) respect.pdf
c) Lefp and q be the pixels at coordinates (10-15) and (15-25) respect.pdf
 
c- Identify a paraphyletic group in this phylogenetic tree and explain.pdf
c- Identify a paraphyletic group in this phylogenetic tree and explain.pdfc- Identify a paraphyletic group in this phylogenetic tree and explain.pdf
c- Identify a paraphyletic group in this phylogenetic tree and explain.pdf
 
C- elegans are one of the most common model organisms in biology- C-.pdf
C- elegans are one of the most common model organisms in biology-  C-.pdfC- elegans are one of the most common model organisms in biology-  C-.pdf
C- elegans are one of the most common model organisms in biology- C-.pdf
 
c++ The following questions are about the Memento design pattern- 6-1.pdf
c++ The following questions are about the Memento design pattern- 6-1.pdfc++ The following questions are about the Memento design pattern- 6-1.pdf
c++ The following questions are about the Memento design pattern- 6-1.pdf
 
C and D are events with probabilities P(C)-0-15-P(D)-0-3- and P(C UD)-.pdf
C and D are events with probabilities P(C)-0-15-P(D)-0-3- and P(C UD)-.pdfC and D are events with probabilities P(C)-0-15-P(D)-0-3- and P(C UD)-.pdf
C and D are events with probabilities P(C)-0-15-P(D)-0-3- and P(C UD)-.pdf
 
C++ Merge(numbers- 0-2-5) is called- Complete the table for leftPos an.pdf
C++ Merge(numbers- 0-2-5) is called- Complete the table for leftPos an.pdfC++ Merge(numbers- 0-2-5) is called- Complete the table for leftPos an.pdf
C++ Merge(numbers- 0-2-5) is called- Complete the table for leftPos an.pdf
 
C++ Deviation from Average (Recursion) Instructions Step 1- Write a.pdf
C++ Deviation from Average (Recursion)   Instructions Step 1- Write a.pdfC++ Deviation from Average (Recursion)   Instructions Step 1- Write a.pdf
C++ Deviation from Average (Recursion) Instructions Step 1- Write a.pdf
 
C++ Data Structures and Algorithms Part 1- -- Write a program to dem.pdf
C++ Data Structures and Algorithms   Part 1- -- Write a program to dem.pdfC++ Data Structures and Algorithms   Part 1- -- Write a program to dem.pdf
C++ Data Structures and Algorithms Part 1- -- Write a program to dem.pdf
 
C) Which number identifies the region responsible for understanding sp.pdf
C) Which number identifies the region responsible for understanding sp.pdfC) Which number identifies the region responsible for understanding sp.pdf
C) Which number identifies the region responsible for understanding sp.pdf
 
c) Every week a family visits their favourite restaurant- The restaura.pdf
c) Every week a family visits their favourite restaurant- The restaura.pdfc) Every week a family visits their favourite restaurant- The restaura.pdf
c) Every week a family visits their favourite restaurant- The restaura.pdf
 
C programing 1- What is the type of the formal parameters in the foll.pdf
C programing  1- What is the type of the formal parameters in the foll.pdfC programing  1- What is the type of the formal parameters in the foll.pdf
C programing 1- What is the type of the formal parameters in the foll.pdf
 
C program Write a loop that will prompt the user to enter characters.pdf
C program  Write a loop that will prompt the user to enter characters.pdfC program  Write a loop that will prompt the user to enter characters.pdf
C program Write a loop that will prompt the user to enter characters.pdf
 
BYou are studying a gene in C- elegans that on Chromosome III and is h.pdf
BYou are studying a gene in C- elegans that on Chromosome III and is h.pdfBYou are studying a gene in C- elegans that on Chromosome III and is h.pdf
BYou are studying a gene in C- elegans that on Chromosome III and is h.pdf
 

Recently uploaded

The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
 
Gyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxGyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptx
 
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
Operations Management - Book1.p  - Dr. Abdulfatah A. SalemOperations Management - Book1.p  - Dr. Abdulfatah A. Salem
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
 
2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptx
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxJose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Salient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptxSalient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptx
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
How to Manage Notification Preferences in the Odoo 17
How to Manage Notification Preferences in the Odoo 17How to Manage Notification Preferences in the Odoo 17
How to Manage Notification Preferences in the Odoo 17
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation
 
An Overview of the Odoo 17 Discuss App.pptx
An Overview of the Odoo 17 Discuss App.pptxAn Overview of the Odoo 17 Discuss App.pptx
An Overview of the Odoo 17 Discuss App.pptx
 

C programming Create a program to find the largest element of an arr.pdf

  • 1. C programming Create a program to find the largest element of an array using pointers Create an array int num[] = {50, 14, 25, 68, 78, 3} Assign the first element of the array to a largest variable using pointer (int large - *num) Use a loop to access each element of the array Compare the large number with each array element using pointer large < *(num+i) If value in large variable is smaller than element, assign the array value to large as large = *(num + i)