Thread: Help.. newbie for loop..stuck with the loop..

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    14

    Help.. newbie for loop..stuck with the loop..

    Hi all master,

    question:
    Write a C program to convert lines of input text to uppercase.
    Do not use any standard library functions.
    The program prompts the user to enter each line of text and does the conversion when the
    text is entered. When an asterisk is entered, the program terminates. Assume that only
    lowercase characters and space are entered.
    Example execution (input text in italics):
    Please enter text line: spiderman
    SPIDERMAN
    Please enter text line: sports car
    SPORTS CAR
    Please enter text line:*
    HAVE A NICE DAY


    Please kindly help me take a look for the program written below:
    as i encountered problem with the loop..convert from small letter to upper letter without issue...

    Code:
    #include <stdio.h>
    
    main()
    {
    
    
    
    	char c, d;
    	int i;
    
    
    	do{
    
    	printf("Please enter text line:");
    
    	  scanf("&#37;c",&c);
    
    
    			d=(c&0x5f);
    			printf("%c", d);
    			
    
    	}while(c!='*');
    
    
    
    	printf("Have a good day\n\n");
    }
    Last edited by jochen; 09-29-2007 at 04:07 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. validation problem in a loop (newbie question)
    By Aisthesis in forum C++ Programming
    Replies: 11
    Last Post: 05-10-2009, 10:47 PM
  2. Visual Studio Express / Windows SDK?
    By cyberfish in forum C++ Programming
    Replies: 23
    Last Post: 01-22-2009, 02:13 AM
  3. Replies: 6
    Last Post: 10-23-2006, 07:22 PM
  4. Help! Stuck in a loop!
    By raell in forum C++ Programming
    Replies: 2
    Last Post: 12-17-2003, 10:47 AM
  5. stuck in a loop
    By sweetly in forum C++ Programming
    Replies: 4
    Last Post: 10-14-2003, 01:24 PM