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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Trouble linking program with -lcrypt 3 166
C Language combined operators 28 137
How to install SVN Command Line Client? 5 133
.NET Core supports which cell phone platforms? 3 37
This tutorial is posted by Aaron Wojnowski, administrator at  To view more iPhone tutorials, visit This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode ( They will have you believe that Unicode requires you to use…
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.
Suggested Courses

739 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