Connecting Tech Pros Worldwide Forums | Help | Site Map

Change colors (background and foreground) and count chars in string

Newbie
 
Join Date: Nov 2007
Posts: 1
#1: Dec 18 '07
Write a program which print your complete name and your city name at the middle two rows of the screen with the following attributes.

Use white back ground and blue foreground color if the length of the name is greater than the length of the city name.

Use Black background and red foreground color if the length of the city name is greater than the length of your name.

Note: Use the strlen function to calculate the length of both strings.

zodilla58's Avatar
Expert
 
Join Date: Dec 2006
Posts: 783
#2: Dec 18 '07

re: Change colors (background and foreground) and count chars in string


Quote:

Originally Posted by kifee

Write a program which print your complete name and your city name at the middle two rows of the screen with the following attributes.

Use white back ground and blue foreground color if the length of the name is greater than the length of the city name.

Use Black background and red foreground color if the length of the city name is greater than the length of your name.

Note: Use the strlen function to calculate the length of both strings.

What is your problem? What type of help do you want? You need a code then better you read posting guidelines

Regards
Newbie
 
Join Date: Dec 2007
Posts: 1
#3: Dec 25 '07

re: Change colors (background and foreground) and count chars in string


Quote:

Originally Posted by kifee

Write a program which print your complete name and your city name at the middle two rows of the screen with the following attributes.

Use white back ground and blue foreground color if the length of the name is greater than the length of the city name.

Use Black background and red foreground color if the length of the city name is greater than the length of your name.

Note: Use the strlen function to calculate the length of both strings.

Ghulan ye Ghulan....lag shan kar hum kawa kana....Sheikh pa ghalatha dey khata dey...sar pay ma khogawa....ha.ha.ha.ha.ha.ha.
Reply