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

What is the intent of the singleton pattern, QUESTION Consider a Univer...

QUESTION Consider a University system which has several sub systems: Student Registration Module Registration Time Tabling Library System Human Resource Manag

Stable marriage Problem, How to make a stale marriage program by implementi...

How to make a stale marriage program by implementing the Gale Shapley algorithm using Java program

TREES, construct a tree where preorder is ABCDFGE

construct a tree where preorder is ABCDFGE

Cad cam, Define explicit, implicit and parametric representation and what a...

Define explicit, implicit and parametric representation and what are their advantages?

Application software, Application Software:   Application software is ...

Application Software:   Application software is designed and developed to accomplish one or more specific task or solve a particular problem.    Application software may be

Port in a computer, what is the need of a port in a computer?

what is the need of a port in a computer?

Database design, design railway maintenance system. draw er diagram.

design railway maintenance system. draw er diagram.

DBMS, define transaction with its properties? And also explain the transiti...

define transaction with its properties? And also explain the transitive dependencies with form

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