---
title: "How to add to and display values of array?"  
description: "How to add to and display values of array?"  
author: "Amit Singh"  
published: 2011-03-18  
updated: 2020-09-22  
canonical: https://www.mindstick.com/interview/451/how-to-add-to-and-display-values-of-array  
category: "cold fusion"  
tags: ["cold fusion"]  
reading_time: 1 minute  

---

# How to add to and display values of array?

For Example\
<cfset fuitname[1][1] = “apple”>\
<cfset fuitname[1][2] = “banana”>\
<cfset fuitname[2][1] = “mango”> \
<cfset fuitname[2][2] = “grapes”>\
\
Display the value:\
<cfoutput>\
The first element of fruitname is #fruitname[1][1]# and second is #fruitname[1][2]#\
</cfoutput>\
\
output:\
The first element of fruitname is apple and second is banana.

## Answers

### Answer by Amit Singh

For Example\
<cfset fuitname[1][1] = “apple”>\
<cfset fuitname[1][2] = “banana”>\
<cfset fuitname[2][1] = “mango”> \
<cfset fuitname[2][2] = “grapes”>\
\
Display the value:\
<cfoutput>\
The first element of fruitname is #fruitname[1][1]# and second is #fruitname[1][2]#\
</cfoutput>\
\
output:\
The first element of fruitname is apple and second is banana.


---

Original Source: https://www.mindstick.com/interview/451/how-to-add-to-and-display-values-of-array

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
