Write a program to swap two names between two variables, Basic Computer Science

Assignment Help:

QUESTION

(a) Write a program to swap two names between two variables for examples:

N1 = "Mary Anne"

N2 = "Queen Mary".

The program should make use of an appropriate Function (for e.g. SwapFunc() ) and pointers to do this.

Your program should have three blocks namely the function declaration , the main and finally the function definition.

The Function SwapFunc() should be called from main.

The program should display the names in each variable before and after calling the function SwapFunc() in main.

(b) Write a piece of code (C or C++) to declare a pointer that is pointing to an array of characters named mychar for e.g.

                                mychar may contain the following five characters z, y, x, w, v

Your program should include codes to declare the array and the pointer to the array. It should also include codes to display the address of the first element in the array using pointers.

Using a loop for the pointers the subsequent codes should display the addresses of the four remaining characters.


Related Discussions:- Write a program to swap two names between two variables

Input/output (i/o) unit, Input/output (I/o) unit: This unit provides th...

Input/output (I/o) unit: This unit provides the interface between the computer and the computer peripherals. A computer peripheral is any unit, which is attached to, but is no

Computer science, You recently returned some homework I completed but i lef...

You recently returned some homework I completed but i left of the final 10 questions. Should not take long just needs some commands interpreted. How much will it cost for me to get

Describe FCFS Scheduling algorithm ?, FCFS algorithm also known as: • Firs...

FCFS algorithm also known as: • First-In-First-Out (FIFO) • Run-Until-Done • Run-to-Completion • Possibly, First-Come-First-Served algorithm is the easiest scheduling algorithm i

CAI, what is CAI? explain its pit falls.

what is CAI? explain its pit falls.

How will url services be affected, URL services has two divisions. Basic we...

URL services has two divisions. Basic webpages and custom webpages. Ricky Vega, Custom's manager wants to find out why Custom is not profitable. He has prepared the following repor

Write a note on file permissions on linux, Question 1 Write a note on a...

Question 1 Write a note on advantages and disadvantages of Linux 2 Write a note on "File Permissions" on linux 3 Explain the usage of following Linux commands Cd kill

Applications software, Applications Software: General aspects on appli...

Applications Software: General aspects on applications software. Applications software is the program that allow the user to get the required work done. In other words, applic

Constant , Constant: In contrast to a variable, which is used as ident...

Constant: In contrast to a variable, which is used as identifier for a value and which can change, constants are identifiers that are used for values, which cannot be changed.

What is the definition of macro?, Definition of the macro A macro is a col...

Definition of the macro A macro is a collection of repetitive instructions in a program which are codified only one time and can be used as many times as required. The major differ

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd