Thread: Generate random uppercase & lowercase

  1. #1
    Registered User
    Join Date
    Oct 2019
    Posts
    7

    Generate random uppercase & lowercase

    Hello everybody! I need a program that randomly converts a letter, from the upper case to the lower case and vice versa depending on a parameter p:
    If p <1, then the letter will be converted to the uppercase <-> lowercase or vice versa.
    If p = 1, then it will remain unchanged
    I did the string transformation with atof: p = atof (str);
    And the random generation of a number between 0 and 1, with
    Code:
    float sample = rand ()% 100 / 99.0;
    In function main, my program must to start with srand(42);
    Input: It's raining outside
    Output: It'S rAiNIng oUTsiDe

  2. #2
    misoturbutc Hodor's Avatar
    Join Date
    Nov 2013
    Posts
    1,736
    Cool

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. lowercase/uppercase conversion help
    By Dylan Dynes in forum C Programming
    Replies: 2
    Last Post: 10-15-2014, 07:17 PM
  2. Replies: 6
    Last Post: 10-01-2014, 07:43 PM
  3. how to detect a lowercase or uppercase char?
    By Axel in forum C Programming
    Replies: 5
    Last Post: 09-04-2005, 12:28 PM
  4. Uppercase and lowercase
    By StarOrbs in forum C++ Programming
    Replies: 4
    Last Post: 03-09-2005, 04:18 PM
  5. Uppercase & Lowercase
    By Dennis in forum C Programming
    Replies: 2
    Last Post: 11-14-2002, 08:07 AM

Tags for this Thread