Skip to content

MyUstaadG

Learn to Serve

  • Computer Science
    • Software
    • Computer Tips
    • Coding
      • Conditional Structures Exercises
      • Loops Exercises
      • Arrays Exercises
      • Python Exercises
    • Microsoft Office
      • MS Excel
      • MS Word
  • Videos
    • Funny Videos
    • Health and Fitness Videos
    • PUBG Videos
    • Technology Videos
  • News
  • Funny
  • Memes
  • Playwright Tutorials
  • Tutorials
  • Toggle search form

Write a Program that Inputs Values into an Array and Displays the Values of the Array

Posted on October 15, 2021 By myustaadg.com
Spread the love

Write a Program that Inputs Values into an Array and Displays the Values of the Array

So let’s Write Code:

Introduction to C++ Programming | Download and Install Dev C++ Compiler

Let’s build logic First:

Algorithm for code:

  • Start
  • Declare an array capible of holding 5 integer values.
  • Input Integers in Array.
  • Store Integer into the array.
  • Print the stored integer.
  • Finish Program
Write a Program that Inputs Values into an Array and Displays the Values of the Array.
#include<iostream>
using namespace std;
main()
{
int temp[5];
cout<<"Enter value in 1st element of temp. ? ";
cin>>temp[0];
cout<<"Enter value in 2nd element of temp. ? ";
cin>>temp[1];
cout<<"Enter value in 3rd element of temp. ? ";
cin>>temp[2];
cout<<"Enter value in 4th element of temp. ? ";
cin>>temp[3];
cout<<"Enter value in 5th element of temp. ? ";
cin>>temp[4];
cout<<"Values in array temp are:"<<endl;
cout<<temp[0]<<endl;
cout<<temp[1]<<endl;
cout<<temp[2]<<endl;
cout<<temp[3]<<endl;
cout<<temp[4]<<endl;
}

Hope You will learn Something. Happy Coding.

Visit my YouTube Channel as Well๐Ÿ˜‡ https://www.youtube.com/watch?v=JuIHQ9cLSEw&list=PLbIhkHxfUIItTdcyCb34uRIrPJbXBndIl&index=4

Click on the below Links for more Programing Exercises:

Conditional Structure Exercises: ๐Ÿ‘‰https://myustaadg.com/category/programming-exercises/conditional-structures-exercises/

Array Exercises: ๐Ÿ‘‰https://myustaadg.com/category/programming-exercises/arrays-exercises/

Arrays Exercises, Programming Exercises Tags:Algorithm that Inputs Values into an Array and Displays the Values of the Array, Arrays, arrays codes, Arrays exercises, Arrays in C++, Arrays in C++ Programming with examples, Arrays with example, C++ Array program examples with output, C++ Arrays, C++ Arrays with examples, How do I print certain elements of an array?, How do we input values into an array in C, How do you display the contents of an array?, how do you initialize an array in c++, How do you input values into an array?, how to display elements of arrays, how to input values into an array in c++, how to print elements of array using c++, How to write a program to input 10 integer numbers, How to write a program to input 10 integer numbers ... 5 answers May 5, How to Write down a program to input 10 numbers in array, Simple arrays code, Write a Algorithm that Inputs Values into an Array and Displays the Values of the Array, write a program in C++ to input values into an array and display them., write a Program that input 10 values in an array and display, Write a Program that Inputs Values into an Array and Displays the Values of the Array, Write a program to display array

Post navigation

Previous Post: Best Attitude Of Different Outfits And Cool Emote In PUBG Mobile | PUBG Copyright Free Video | PUBG Copyright Free Video For YouTube Shorts
Next Post: Write a program that inputs ten values in an array and calculates the sum of these values.

More Related Articles

A toy store is very successful in two of its products: clowns and dolls. Suppose, Each clown weighs 112 g and each doll 75 g. Write a program that reads the number of clowns and dolls sold in the last order and calculates the total weight of the package to be shipped | python Programming Programming Exercises
Write a program that inputs marks of ten students in an array and counts the number of students that have marks between 80 and 100. Arrays Exercises
Write a program that inputs ten values into an array. It finds out the average value of the array Arrays Exercises
Write a program that asks the user for two numbers and shows their division on the screen. If the divisor is zero the program must display an error | Python Programming Programming Exercises
Write a program that inputs values into a one-dimensional array of ten elements. Draws a bar chart or histogram. Arrays Exercises
Write a program that sorts an array in ascending order by passing the array to a function. Arrays Exercises

Copyright © 2022 MyUstaadG.

Powered by PressBook Blog WordPress theme