adspace


W.A.P to take input of an array and display the entered no.
in dos.

Answer Posted / Sanjeev Kumar Verma

Here's a simple example in C++ that takes user input for an array and displays its elements:

```cpp
#include<iostream>
using namespace std;

int main() {
int n; // number of elements in the array
cout << "Enter the number of elements in the array: ";
cin >> n;

int arr[n]; // declare an array of size n
cout << "Enter the elements of the array:" << endl;
for(int i=0; i<n; i++) {
cout << "arr[" << i << "]: ";
cin >> arr[i];
}

cout << "The entered elements are: " << endl;
for(int i=0; i<n; i++) {
cout << arr[i] << " ";
}
return 0;
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

sir , i am prparing for IOCL engineergin post please send me the old placement papers

2130


send me e-mail on dell tech question papers 2011 -2012

1909


sir, please send me the last three years exam papers conducted by CPCL- RECRUITMENT EXAM FOR Recruitment of Engineer ELECTRICAL ENGINEERING. A Soon as possible. i would be greatfull to u

1962


Prepare the UGC CSIR net question papers those are enough. The question paper will be of 50 questions in size each 3 marks and with a negative of -1 for each wrong answer

3108


Draw the diagram showing the function stack, illustrating the variables that were pushed on the stack at the point when function f2 has been introduced . type def struct { double x,double y} point; } main( int argc, char *arg[3]) { double a; int b,c; f1(a,b); } f1(double x, int y) {point p; stack int n; f2(p,x,y) } f2(point p, double angle) { int i,j,k,int max;

2137


hi , anyone plz end nic model papers to my id

2378


Please send me the ongc old question papers

3170


I have applied for the post of Section Engineer. plz anyone send me the previous question paper. i did my engineering in Information Technology.

2087


please send me latest Aptitude Test paper

2277


i need the placement paper of ford IT service...

2092


can any one send me the configuration of cisco 1841 router????/

1973


when will the group1&group2 exams will be held

1877


what are the main points to be included in our introduction when asked in hr...??

2047


please provide me the type of questions or question pattern of bally.

1969


if u have question papers/sample papers of any of PSUs,plz send me at dinesh.pandey3@gmail.com

1946