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

Python Help, I need help! import cgi, cgitb cgitb.enable() HTML_head = ''C...

I need help! import cgi, cgitb cgitb.enable() HTML_head = ''Content-type: text/html\n\n'' HTML_top = '''''' Restaurant Results '' Restaurant Results '''''' HTML_bottom =

List and explain different types of media, Question 1 List and explain the...

Question 1 List and explain the ways used to close an MS Word document Question 2 What is MS-Excel? List the steps involved in starting Microsoft Excel Question 3 What i

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

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

Handling Text Files, I. Write an application that accomplishes the followin...

I. Write an application that accomplishes the following tasks: 1. Read a text file that contains, integers, doubles, alphabet, alphanumeric, and others. The name of the input fil

Java programming, Write a program that lets the user play the game Rock, Pa...

Write a program that lets the user play the game Rock, Paper, Scissors against the computer. The program should work as follows: ? When the program begins, the results of the prev

Switching mechanisms , SWITCHING MECHANISMS: Switching mechanisms are ...

SWITCHING MECHANISMS: Switching mechanisms are techniques devised to send messages in many dinections at once and to ensure that these messages are received with a minimum of

What is mixing, Question 1 Briefly explain waveform Characteristics ...

Question 1 Briefly explain waveform Characteristics Question 2 Write a note on: types of Microphones Question 3 Briefly explain Magnetic Properties of Audiotape

Write a brief note on firewalls, Question 1 Explain the TCP/IP protocol la...

Question 1 Explain the TCP/IP protocol layers Question 2 Write a note Fiber Distributed Data Interface (FDDI) Question 3 Discuss on File Transfer Protocol (FTP)

Describe the binary search algorithm, QUESTION 1 Describe the binary se...

QUESTION 1 Describe the binary search algorithm using an example of your own. QUESTION 2 (a) By showing all your workings, give a big-O estimate for f(x) = (x + 1)lo

Explain initial dynamic model with example, Question 1 Explain initial dyn...

Question 1 Explain initial dynamic model with example Question 2 Discuss the importance of object orientation during system development Question 3 Distinguish between Ob

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