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

I need to purchase books for BCA-II- Maths. The topics are Numerical Methods and Theory of Computation. Which books should I purchase?
Editors-in-Chief: D. Lubinsky; S. Ruscheweyh ISSN: 1617-9447 (print version) ISSN: 2195-3724 (electronic version)
Sakshi
Is a BCA a diploma course or a degree?
It is a degree course.
Pradeep
0 0
9
What is BCA and its scope?
My suggestion is go for B.Tech in cs or it if you are thinking for bca .
Honey
0 0
5
Which is better, B.Sc or BCA?
Both has own importance. But according to me B.Sc is better than B.CA.
Atim
0 0
6
Sir, how to prepare my BCA course I am also a employee in pvt ltd company?
Online BCA Practice and Preparation Tests cover BCA (General Knowledge).
Rajnish

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

Ask a Question

Related Lessons

Shell Scripting - The underrated programming language of system administrators
It is oft repeated that the next wave of IT is automation. But automation is not new - it existed before in terms of automated installation, sending birthday mails etc. It was not untill you actually...

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

An Interesting Discussion About Malloc And Calloc
What are malloc and calloc? Simply putting they are the predefined functions in C language. Malloc( ) and calloc( ) are two such functions which are used for more or less identical purpose and that is...

01 Introduction to Digital Logic
Introduction to Digital logic:

Why Should We Learn Java Language?
Most of starters has confusion today that which of the programming language should be chosen to work on. It totally depends upon your need. As per my opinion, if you want to grow your career in IT industry...

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