UrbanPro

Take BCA Tuition from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Write a program to exchange the first element with the last element of an array.

Asked by Last Modified  

Follow 0
Answer

Please enter your answer

MS SQL SERVER DBA Trainer

IN C Prog: void swap(int *arr,int length) { int a; /*Third Variable*/ a = *arr; *arr = a; arr = a; } In Java: int (int arr) { int a; int len = arr.length; int ar = arr; a = ar; ar = a; ar = ar; return ar; }
Comments

Maths and Computer Science Tutor with 10 years Teaching experience

import java.io.*; import java.util.*; class SawpArray() { public static void main(String args) { int array = new int; int length = array.length; for(int i = 0; i < length; i++) { array = (int)(Math.random()*5); System.out.print(array); } System.out.println(""); ...
read more
import java.io.*; import java.util.*; class SawpArray() { public static void main(String[] args) { int[] array = new int[5]; int length = array.length; for(int i = 0; i < length; i++) { array[i] = (int)(Math.random()*5); System.out.print(array[i]); } System.out.println(""); SwapFirstAndLast(array); } public static void SwapFirstAndLast(int[] array) { for(int i=0;iread less
Comments

Computer Wizard

public void swap(int arr) { int temp; temp=arr.length-1; arr.length-1=arr; arr=temp; System.out.println("print array elements") }
Comments

Tutor

#include iostream using namespace std; int main() { int a,temp; for(int i=0;i less than10;i++) //scan array { cin>>a; } for(int i=0;i>a; } temp=a; a=a; a=temp; for(int i=0;i>a; } return 0; }
read more
#include iostream using namespace std; int main() { int a[10],temp; for(int i=0;i less than10;i++) //scan array { cin>>a[i]; } for(int i=0;i<10;i++) //print scanned array { cout>>a[i]; } temp=a[0]; a[0]=a[9]; a[9]=temp; for(int i=0;i<10;i++) //print exchanged array { cout>>a[i]; } return 0; } read less
Comments

Selenium Java Dealer ( SDET )

public class Arr { public static void main(String args) { // TODO Auto-generated method stub int a={2,4,6,8,10,12,15}; for(int i=0;i<=a.length;i++) { int d=a; a=a; a=d; System.out.println(a); } } }
Comments

Java developer

swap them
Comments

16 Yrs of Experience in Teaching

tmp=a; a=a; a=tmp;
Comments

God Gifted Mathematicians with more than 21 years of experience

Temp= a B=a A= temp
Comments

Java/J2ee,C,C++,DBMS Expert

import java.util.Arrays; public class ExchangeArrayElement { public static E void exchangeArrayElement( E arr){ int length = arr.length; for(int i=0,j=length-1;i read more
import java.util.Arrays; public class ExchangeArrayElement { public static E void exchangeArrayElement( E[] arr){ int length = arr.length; for(int i=0,j=length-1;iread less
Comments

International Corporate Trainer For dotnet Core ,Angular 2 ,C ,C++ and LPT Marathi for RBI Banking

You should learn Networking and hardware by joining profesional training institute and BCA degree is just for show case. It is useless
Comments

View 19 more Answers

Related Questions

How to create project in vb6.0?
Welcome to Free Visual Basic 6 (VB6) tutorial for beginners. This Visual Basic 6 (VB6) tutorial helps you to learn Visual Basic 6.0 (VB6) programming in your own. Assuming you all are beginners to visual...
Shinde
Which language has the best future prospects: Python, Java, or JavaScript?
According to me, "Python" is the programming language having the best future prospect considering the current industry trend. Reason: Python is extensively used in advanced technologies such as Machine...
Atharva
0 0
5
Which institute is a better option for BCA? Symbiosis, Pune or Christ, Bangalore?
Both are equally good but slightly Symbiosis Pune have better placement options so you can select it.
Neoschiptechnologiespvtltd.
0 0
6
Can we apply for a job in a bank after a BCA?
Yes, you can apply for bank jobs after BCA.
Pradeep
0 0
5

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Some formulas of algebra
Algebra: 1. (a + b) = a + 2ab + b 2. (a – b) = a – 2ab + b 3. (a + b) (a – b) = a – b 4. (x + a)(x + b) = x + (a + b)x + ab 5. (x + a)(x – b) = x + (a – b)x –...
K

Computer Generations
After the invention of electricity in the 20th century, computers began using electric power. This led to the rapid development of computers. As a result computer evolved generation after generation. First...

How learn c++??
Hi friends c++ one of most important language in this world . now here we take some tips how to learn c++ by self 1. students study carefully c++ books which comfortable to read. 2.Start with small...

Akshay Kaushik

0 0
0

Tips of learning Java Language/Other Programming Languages
1.You should know the basic concept: If we talk about programming languages so basic concept are same in all the high level languages. So you should know the basic concept firstly then you can easily understand...
I

ICreative Solution

0 0
0

Recommended Articles

Once over with the tenth board exams, a heavy percentage of students remain confused between the three academic streams they have to choose from - science, arts or commerce. Some are confident enough to take a call on this much in advance. But there is no worry if as a student you take time to make choice between - science,...

Read full article >

With the mushrooming of international and private schools, it may seem that the education system of India is healthy. In reality, only 29% of children are sent to the private schools, while the remaining head for government or state funded education. So, to check the reality of Indian education system it is better to look...

Read full article >

Learning for every child starts from a very young age. While the formal methods include school curriculums and private lessons, the informal methods include dancing, music, drawing, and various fun-filling activities. Playing games and practising these types of activities helps the children get out of boredom and...

Read full article >

Appearing for exams could be stressful for students. Even though they might have prepared well, they could suffer from anxiety, tension etc. These are not good for their health and mind. However, following a few exam preparation tips can save them from all these and help them to score good marks. Let’s find out all...

Read full article >

Looking for BCA Tuition ?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for BCA Tuition Classes?

The best tutors for BCA Tuition Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Take BCA Tuition with the Best Tutors

The best Tutors for BCA Tuition Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more