0 like 0 dislike
3.3k views

14. Please write a program that receives 'A' or ‘a’ then outputs 'A'-'Z'.

However, if these characters (C, F, K, V and U) appears, it will show '*' instead.

Template

#include <stdio.h>
int main(int argc, char *argv[]){
int i;	
char input;
scanf("%c",&input); // DO NOT change   // NO need to use ("Enter input: ")

// your conditions start from here

return 0;
}

Input1

A

Output1

AB*DE*GHIJ*LMNOPQRST**WXYZ

 

Input2

a

Output2

AB*DE*GHIJ*LMNOPQRST**WXYZ
[Exam] asked in Mid-term examination by (5.9k points)
ID: 32199 - Available when: Unlimited - Due to: 2017-11-15 16:30
| 3.3k views

18 Answers

0 like 0 dislike
Hidden content!
#include *** * * **
int main(int argc, char *argv[]){
int ** **  
char input;
* ** * *** * *** ** * ** // DO NOT change * ** * NO need to use ** ** **** * input: ")
* *** *
* **
// your conditions start from here
** ** * ** ** * * ** * {
** ** *** * * ** * **** ** *** ** ** * *** *** * * ** * ** * ** *** *** * {
* ** **** * * ***** * ** * ** ** * * ** **** ** ** * ***** ** *
** * ** * ******* * **** *** ******* ** *** *** *
* * *** * * * * ** ** * ** ******* ** {
* * ** *** * *** * *** *** *** ** ** * * * *** * ** ** * * *** ** * *** **** input);
* * * * ** * * * *** * ** *** ****** **** *  
}
return 0;
}
100/100 answered by (254 points)
edited by
0 0
Case 0: Wrong output
Case 1: Wrong output
0 0
Case 0: Correct output
Case 1: Wrong output
0 0
Case 0: Correct output
Case 1: Correct output
0 like 0 dislike
Hidden content!
*** ** ** **** * *
int ** argc, char ** *
int ** ** **
char * *
* ** * ** ** ** * **
* = 'A'; * * * 'Z'; * *
* ** ** * * * *
if( * * * * * **** ** * **
* * * * *** ** *
}
**
* * ** *** * * **
}

*** 0;
}
100/100 answered by (290 points)
0 0
Case 0: Correct output
Case 1: Correct output
0 like 0 dislike
Hidden content!
** ** ******* ** * ***
int * ** char ****
int *** ** *** *
char
** * * * * * ***
**** *** * * * nay ** **** *

* ** 0;
}
1/100 answered by (449 points)
0 0
prog.c: In function 'main':
prog.c:8:1: error: expected ';' before 'return'
 return 0;
 ^~~~~~
0 like 0 dislike
Hidden content!
* * * * *
int * * argc, char *
int ***** * * * *
char * **
***** ** * * * ** *

***** * * ***** for(i = 'A', i ***** 'Z', * *
* * * ** * * * * *** **** ** * ** * * * ** ****
** * * * * *** ** ** * ** *** * ****
*** ** * **
*** * * * }
* **** *
}
* ** * else
*** ** ** * * *** *** **
}

* 0;
}
1/100 answered by (243 points)
edited by
0 0
Case 0: Wrong output
Case 1: Wrong output
0 0
prog.c: In function 'main':
prog.c:7:28: error: expected ';' before ')' token
  for(i = 'A', i <= 'Z', i++){
                            ^
prog.c:7:28: error: expected expression before ')' token
prog.c:8:7: error: 'x' undeclared (first use in this function)
    if(x=='C'||x=='F'||x=='K'||x=='U'||x=='V'){
       ^
prog.c:8:7: note: each undeclared identifier is reported only once for each function it appears in
prog.c:14:2: error: 'else' without a previous 'if'
  else
  ^~~~
prog.c: At top level:
prog.c:18:1: error: expected identifier or '(' before 'return'
 return 0;
 ^~~~~~
prog.c:19:1: error: expected identifier or '(' before '}' token
 }
 ^
0 like 0 dislike
Hidden content!
* * *** ** *
** * ** * *** *
*** * * **

** * ** * * * ** * // DO NOT ** * * * NO ** to use * * ** * * *** ** * *

// * * ** ** **

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

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

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

* * * * * *** ** ** ** ** * * * * ** 'Z'; * * *
** * *** **
*** * ** ** ** **** * * * ** ** * ***
** * ** ** ***
* *
** * ** * * *** ** ** ***
}

* * * * * ** *** 0;
}
100/100 answered by (252 points)
0 0
Case 0: Correct output
Case 1: Correct output
0 like 0 dislike
Hidden content!
#include ** **** * * **
* ** * * * * **

int main(int argc, char *argv[]) { * ** *** *
char a;

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

* * * *** * **** **** **
******* **** * * * * *** ** * ** if (a == 'C'||a == 'F'||a == 'K'||a == 'V'||a == 'U'){
** ***** * * **** *** ** ***** * ** ** * * * ** **** * ** ****** *
** * *** ** * ****** * *** * * * * ** ***
*** * *** ** **** *** else
** * * ** * * ******** *** * * *** * *** * * * ** **
** *** **** * ** *** *

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

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

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

*** ** * *** ** * ***
** ** ** * if * == * * ** == * **** ** == **** == * ** == *
**** * * ** * ****** * *** ** **** *
**** * * * * *
* * * * *
** * * *** **** ** *** * ***
}
* 0;
}
100/100 answered by (268 points)
0 0
Case 0: Correct output
Case 1: Correct output
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.17.202
©2016-2025

Related questions

0 like 0 dislike
19 answers
[Exam] asked Nov 14, 2017 in Mid-term examination by nat236919 (5.9k points)
ID: 32015 - Available when: Unlimited - Due to: 2017-11-15 16:30
| 3.1k views
0 like 0 dislike
21 answers
[Exam] asked Nov 15, 2017 in Mid-term examination by nat236919 (5.9k points)
ID: 32695 - Available when: Unlimited - Due to: 2017-11-15 16:10
| 3.4k views
0 like 0 dislike
22 answers
[Exam] asked Nov 14, 2017 in Mid-term examination by nat236919 (5.9k points)
ID: 31997 - Available when: Unlimited - Due to: 2017-11-15 16:10
| 2.1k views
0 like 0 dislike
22 answers
[Exam] asked Nov 14, 2017 in Mid-term examination by nat236919 (5.9k points)
ID: 31985 - Available when: Unlimited - Due to: 2017-11-15 16:10
| 2k views
0 like 0 dislike
20 answers
[Exam] asked Nov 14, 2017 in Mid-term examination by nat236919 (5.9k points)
ID: 31981 - Available when: Unlimited - Due to: 2017-11-15 16:10
| 1.7k views
12,783 questions
183,442 answers
172,219 comments
4,824 users