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 does power theft happen in Smart meters?
Smart meters consist of two units: The metering device, which is in the custody of the distribution or utility company and a display unit that is at the consumer's place. Typical smart meters being deployed...
Karthik
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
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
Should I do a BCA+MCA or a B.Tech?
B Tech is the most coveted degree and most preferred among jobs by MNC only if u r unbale to develop desire for BTech and good at programming skills for for BCA+MCA
Damanpreet
0 0
5
Can someone do a BCA even if heâ??s not good in maths?
u can do provided u have to get good hold on maths with the days to go
Elnaz
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

JAVA - Object Cloning
JAVA - Object Cloning Is the way of creating the same copy of object without calling the class constructor. It means we can make any class object multiple times without calling its default constructor....

Understanding Asymptotic Notations And Big Oh(O)
What are asymptotic notations for complexity analysis?A problem may have numerous algorithmic solutions. In order to choose the best algorithm for a particular task, you need to be able to judge how long...

What Is Java? Explain The History Of Java
i. Ovierview: Java programming language was originally developed by Sun Microsystems which was initiated by James Gosling and released in 1995 as core component of Sun Microsystems' Java platform (Java...

TestNG Annotations and its sequence
public class TestNGAnnotations { @BeforeMethod public void beforeM() { System.out.println("Before Method"); } @AfterMethod public void afterMethod() { System.out.println("After Method"); } @BeforeClass...
S

Sarthak C.

0 0
0

Swapping Two Numbers
Q. Swap two numbers using the following function. Complete the function. You won't be allowed to use a temporary variable to swap the two numbers. void swap ( ... ) { /* Swap code goes here */ } ...

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