Posted on 1999-01-08
Last Modified: 2010-04-15
write functions to (a) left justify , (b)right justify ,(c) center justify agiven string. Test the fuctions with 5 strings
Question by:samuelccs

Expert Comment

ID: 1255637
Post the code you have so far.

Accepted Solution

jhurst earned 30 total points
ID: 1255638
when I saw the previous question from you I thought that it may just be a coincidence that something I had set in class turned up.  Now that I see all the assignments here I am much more suspicious.

Expert Comment

ID: 1255639
Easily done

Tip: See the size of your string and then do calculation when a string is entered.

For right justification ... you just use the puts() command
For Left, use strlen() function to count your input string. Use the array size minus the strlen(input_string). Get the result and start from that index.
For centre, use the % the input string by 2. Then take the remainder minus from %2 of index. Start from the

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Binary Bomb: Phase 4 func4 3 310
Where is my core dump file in Ubuntu? 12 442
libcurl - taking long time on curl_easy_perform 11 352
distributed computing in Python 4 115
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now