0 like 0 dislike
4.2k views

Please write a program that receives 7 characters aweSOME in the same line. It then changes the first 3 lowercase characters into uppercase and the last 4 uppercase characters into lowercase. Kindly use a given template to finish the task.

Example(template)

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
	char s1,s2,s3,s4,s5,s6,s7; // You can change these declarations, it entirely depends on you.
	printf("Input your characters:\n"); // Do not change this

	// Your conditions start from here
	
	return 0;
}

Input

Input your characters:
aweSOME

Output

AWEsome

Suggestion

You may need a little help from your friendly table, here is ASCII table.

[Exercise] Coding (C) - asked in Chapter 3: Branching, Looping and Functions by (5.9k points)
ID: 29558 - Available when: Unlimited - Due to: Unlimited
| 4.2k views

13 Answers

0 like 0 dislike
Hidden content!
* * *
** * *** **** *** **

** ** * * ** ** ***** *** or * ** * *** * ** * ** **** * or ** ** */

** *** * * * ** * {
*** * * ***** * * * ** * *
* * ****
** * * * ** * = ****
**** * * * *** = * * *
* *** * * = ** * *
* * * * * a4 = * * * *
* * * * ** * = *
* **** ** ** = *** *
* ** * *** * ** = * **

* ** * *** *
** == * ** * a2 == ** *** ** ** == * * * * *** a4 == * *** * a5 == * * * ** * ******* a6 == * * ****** a7 == * )
**** * * * ** * ***** * * * ** * * ** * ** ** * ** + ** * * * - * + * - ** * * + *** - ** ** * - * - * - * - * ** - ** - - * -
**** * * * *
* * * * *** * ** * ** *
** * * * * * * **
**
100/100 answered by (252 points)
0 0
Case 0: Wrong output
0 like 0 dislike
Hidden content!
* * * * * *** **
* **** * * ****

/* run this ** * *** * the * ** *** * or add your own * * * * ** ** * or * loop */

int ** ** * char ** {
** *** * ** * ** char * * ***

* * ** * *** * ** * * * * your * * * * * *
** * q = *
* ******* * * * w = * ** *
** * * e = ***** *
* ** **** ** r = ** *** *
*** ** * ** t = ** * *
**** * * y = **** *
* *** * *** u = **


** **** * ******
** ** *** *
*** ** **

** * * ** if( q ** * * 'a' * * ** q * * 'z' )
** * * * * * * * * ***** *** ** **** q + ** * * - * *
* * * * *** * * * ** * if( w ** ** 'a' * *** * w 'z' )
* * * *** *** * * * * ** * * *** *** * w + * ** * - **
* ***** * * * ** * ** * if( e * * 'a' * ** ** * e ** * 'z' )
* ** * * * * * ** * * * ** ** *** * *** e + ** ** * - **
**** * * ** ***** **** **** * if( r * * 'A' * * ** **** r *** 'Z' )
* ** ** * * * * **** * *** ** r - ** - ***
**** * ** * * * **** if( t ** 'A' * ** * ** * t * * 'Z' )
* *** * * * ***** *** * * * * * t - ** * - * *
* * ** * * * * * *** ** if( y * * * 'A' **** * * ** * y * ** 'Z' )
* * * * *** * ** * * *** * * ** y - * **** - * *
* ** ** ** * * *** if( u **** * 'A' * * * u * * 'Z' )
** * * * * * ** * * ** * * * ** ** *** * * * u - * * * - *
* * *** * * * * **
****** * * *

* **** * * **
* ** * * * **** 0;
}
100/100 answered by (268 points)
0 1
Case 0: Wrong output
0 like 0 dislike
Hidden content!
* * ** **** * **
** ** ** ***** * *

/* run this ** * using the * pauser or add your own getch, ** * * **** * or input loop */

int * ** * argc, char * * {
***** ** char s[7];
* * ** int i;
* ** ** * * * * ** * ** * your ***** * * *
***** * * ***
** * * * * ** * *** * *
** *** * * * ** * * * if ***
* * * * ** * *** * ** *** * * * * *** * *** * * * * * ****
* * * ** * * ** ** * * * **** s[i] += * * ***
* ** * *** * ** * * * }else {
* * **** * * * * ** ***** * * * ** * *** **
**** * * ***** *** s[i] -= ** *
* * *** * * * * * * }
* * ** * * }
** * * ****** * *** * **
*** *** * ** * ** **** ** *
** * * * **** * * * * * ***** * * **
**** * * ** }
**** * ****
*** * * ** return 0;
}
answered by (5.9k points)
0 0
Case 0: Correct output
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.50.50
©2016-2025

Related questions

0 like 0 dislike
17 answers
[Exercise] Coding (C) - asked Oct 27, 2017 in Chapter 3: Branching, Looping and Functions by nat236919 (5.9k points)
ID: 29618 - Available when: Unlimited - Due to: Unlimited
| 6k views
0 like 0 dislike
24 answers
[Exercise] Coding (C) - asked Nov 2, 2017 in Chapter 3: Branching, Looping and Functions by nat236919 (5.9k points)
ID: 30241 - Available when: Unlimited - Due to: Unlimited
| 6.8k views
0 like 0 dislike
20 answers
[Exercise] Coding (C) - asked Nov 2, 2017 in Chapter 3: Branching, Looping and Functions by nat236919 (5.9k points)
ID: 30222 - Available when: Unlimited - Due to: Unlimited
| 6k views
1 like 0 dislike
23 answers
[Exercise] Coding (C) - asked Oct 20, 2017 in Chapter 3: Branching, Looping and Functions by nat236919 (5.9k points)
ID: 28130 - Available when: Unlimited - Due to: Unlimited
| 7.2k views
12,783 questions
183,442 answers
172,219 comments
4,824 users