does anyone know how to do this layout in C? the inputs are account no, depositors name and account balance.... while the interest would be 10% from the account balance and total acct balance is the sum of account balance and interest... pls help me, i'm a first year college and just beginning to learn it . the layout should be the same as below (pls imagine it as if it was centered)
ABC BANK
XBC Ave., City
DEPOSITORS’STATEMENT OF ACCOUNT
AcctNo. Depositor Name AccountBalance InterestEarned TotalAccountBalance
(int type)(string of 25 characters)(float type) (float type) (float type)
are you asking how to print centered text or how to solve a problem?
salem, does C still require a global variable on structs? I have not done serious C since the mid 90s.
i'm working on it right now, in the solving, i kinda know how to do it except for string because i'm still kinda confused in there. and for the centered text im using "\t", is that fine or is there other way to center it?
Question: when you say center what size screen will it be centered on?
My screen is about 23 1/2", (58.75 cm), wide, but the console window that programs run in is about 13 1/2", (33.75 cm), wide.
First you have to know how wide the display area is then how many characters will fit on a line, this would be a fixed width font. Then you will have a start at knowing how to center the output.
You could use (strlen()) to determine the length to calculate where to start the string and just pad the left with however many spaces you need.