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

Graphs, Find the corresponding matrix of the digraph above

Find the corresponding matrix of the digraph above

CAI, What is CAI? Explain its pitfalls.

What is CAI? Explain its pitfalls.

Computer, identify application software from the list? ms excel linux inter...

identify application software from the list? ms excel linux internet explorer adobe photshop sound card driver window disk manger adobe dream weaver windows file explorer

Architecture, explain how modern computers conform to john von nuemann''s a...

explain how modern computers conform to john von nuemann''s architeture?

Stack instructions, These instructions permit the use of the stack to store...

These instructions permit the use of the stack to store or recover data. POP POPF PUSH PUSHF POP INSTRUCTION Purpose: It improves a portion of information from the stack POPF INST

Necessary nurses records, Necessary Nurses Records The software shoul...

Necessary Nurses Records The software should generate all registers/reports in detail summary for various permutations and combinations of options. A powerful SQL (Structure

Working of a computer, Working of a Computer Computer may be div...

Working of a Computer Computer may be divided into the following units     Input Unit     Main Memory or Primary Storage Unit     Arithmetic-Logic Unit

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