Write the header of the C program Write the beginning of the main function Initialize a string called first_string with the constant value "C programming is nice**" using a string  pointers

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter9: Completing The Basics
Section: Chapter Questions
Problem 7PP
icon
Related questions
Question

in c language

Write a program which performs the following actions:

  1. Write the header of the C program
  2. Write the beginning of the main function
  3. Initialize a string called first_string with the constant value "C programming is nice**" using a string  pointers
  4. Initialize a string called second_string with the constant value "C language is difficult" using a string pointer
  5. Display first_string and second_string in two consecutive lines
  6. Display a message that shows if the two strings have the same length (hint: use sizeof).
  7. Assume now that both strings have the same size. Write only three statements to swap the two strings’ contents (swap means the content of the first string becomes the content of the second string and vice-versa)
  8. Display again the two strings to check whether they have been swapped
  9. Write the correct symbol to close the main function
Expert Solution
steps

Step by step

Solved in 4 steps

Blurred answer
Knowledge Booster
Declaring and Defining the Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr