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
sir , i am prparing for IOCL engineergin post please send me the old placement papers
send me e-mail on dell tech question papers 2011 -2012
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
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
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;
hi , anyone plz end nic model papers to my id
Please send me the ongc old question papers
I have applied for the post of Section Engineer. plz anyone send me the previous question paper. i did my engineering in Information Technology.
please send me latest Aptitude Test paper
i need the placement paper of ford IT service...
can any one send me the configuration of cisco 1841 router????/
when will the group1&group2 exams will be held
what are the main points to be included in our introduction when asked in hr...??
please provide me the type of questions or question pattern of bally.
if u have question papers/sample papers of any of PSUs,plz send me at dinesh.pandey3@gmail.com