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

Explain the term "algorithmic delay", QUESTION a) What is Time Division...

QUESTION a) What is Time Division Multiplexing (TDM), illustrate your answer with a diagram b) Describe four types of RTCP messages c) i) What is silence compression in I

Communications programs , Communications Programs : By communications prog...

Communications Programs : By communications programs, we mean those programs which allow a computer to communicate via a transmission cable to another electronic device. Here we d

Visual Basic 2012, Can someone help me write a code for force = mass * acce...

Can someone help me write a code for force = mass * acceleration.

Accessing folders and printers, Accessing Folders and Printers Accessi...

Accessing Folders and Printers Accessing folders, files and printers of another computer is as easy as accessing another computer. To access folders and printers of another c

Python Tuples , A tuple is one more series data type that is like to the li...

A tuple is one more series data type that is like to the list. A tuple consists of a number of values divided by commas. Not like lists, though, tuples are enclosed inside parenthe

System software, Name and explain the classifications of computers

Name and explain the classifications of computers

Diffrence Between FAT 32 And NTFS.., Dear sir please define what is the dif...

Dear sir please define what is the difference between FAT 32 and NTFS .

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