Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


write a program to insert an element into an array

Answers were Sorted based on User's Feedback



write a program to insert an element into an array..

Answer / dhaivat

void arrayins(int arr[], int& n, int pos, int item)
{
if (n==MAX) //Size of array is MAX
cout<<"Overflow\n";
else
{
for (int x=n; x>=pos; x--)
arr[x+1]=arr[x];
arr[pos]=item;
n++;
cout<<item<<" inserted in the array\n";
}

Is This Answer Correct ?    17 Yes 47 No

write a program to insert an element into an array..

Answer / gokul balaji

#include<iostream.h>
#include<conio.h>
void main()
{
int a[5],i;
for(i=0;i<5;i++)
{
cin>>a[i];
}
for(i=0;i<5;i++)
{
cout<<a[i];
}
}

Is This Answer Correct ?    15 Yes 66 No

write a program to insert an element into an array..

Answer /

import java.util.*;
import java.io.*;

public class project
{
public static void main (String[]args) throws
IOException
{
BufferedReader dataIn = new BufferedReader
(new InputStreamReader(System.in));

System.out.println
("******************************");
System.out.println("
+++++++++++++++ ");
System.out.println(" [1]
Insert ");
System.out.println(" [2]
Delete ");
System.out.println(" [3]
Search ");
System.out.println(" [4]
Sort ");
System.out.println("
+++++++++++++++ ");
System.out.println
("******************************");
}
}

Is This Answer Correct ?    20 Yes 81 No

write a program to insert an element into an array..

Answer / chandrasekhar

#include<iostream.h>
#include<conio.h>
void main()
{
int a[5];
int i;
clrscr();
cout<<"enter the elements into an array";
for(i=0;i<5;i++)
{
cin>>a[i];
}
getch();
}

Is This Answer Correct ?    103 Yes 171 No

write a program to insert an element into an array..

Answer / namitha

#include<iostream.h>
main()
{
int a[20];
cout<<"enter an element into the array:";
cin>>a[0];
}

Is This Answer Correct ?    13 Yes 89 No

write a program to insert an element into an array..

Answer / vineeshtkm

main()
{
int a[10],item;
cout<<"Enter Item:";
cin>>item;
a[0]=item;
}

Is This Answer Correct ?    74 Yes 189 No

Post New Answer

More C++ General Interview Questions

Explain operator overloading.

0 Answers  


How would you use the functions randomize() and random()?

0 Answers  


Badboy is defined who has ALL the following properties: 1. Does not have a girlfriend and is not married. 2. He is not more than 23 years old. 3. The middle name should be "Singh" 4. The last name should have more than 4 characters. 5. The character 'a' should appear in the last name at least two times. 6. The name of one of his brothers should be "Ram" Write a method: boolean isBadBoy(boolean hasGirlFriend , boolean isMarried, int age , String middleName , String lastName , String[] brotherName); isHaveGirlFriend is true if the person has a girlfriend isMarried is true if the person is married age is the age of the person middleName is the middle name of the person lastName is the last name of the person brotherName is the array of the names of his brothers

1 Answers  


What does ctime() do?

0 Answers  


What's the most powerful programming language?

0 Answers  


What are the different types of variables in C++?

1 Answers  


What is do..while loops structure?

0 Answers  


When we use Abstract Class and when we use Interface?where we will implement in real time?

0 Answers  


What is c++ in english?

0 Answers  


What are the extraction and insertion operators in c++? Explain with examples.

0 Answers  


What is main function in c++ with example?

0 Answers  


How do we balance an AVL Tree in C++?

0 Answers   Impetus,


Categories