4 like 0 dislike
378 views

Please write a program that can identify a value's characteristic based on ASCII table. It must identify:

  1. 0-9 is a digit
  2. A-Z is a capital character
  3. a-z is a small character
  4. Besides those conditions, it shows '%c is unknown'.
     

Kindly use the given template to finish the task. Be advised that your outputs must be exactly the same as the shown outputs below.

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 a;
	printf("Define:\n");
	scanf("%c",&a);
	
// Your condition starts from here
	
	return 0;
}

 

Input#1

Define:
6

Output#1

6 is a digit

 

Input#2

Define:
A

Output#2

A is a capital character

 

Input#3

Define:
f

Output#3

f is a small character

 

Input#4

Define:
/

Output#4

/ is unknown

 

Suggestion

It's time to use your favourite table: ASCII

 

[Normal] Coding (C) - asked in Questions Bank by (5.9k points)
ID: 30264 - Available when: Unlimited - Due to: Unlimited
| 378 views
0 0
1.當我需要使用者輸入資料時,我可以用那個函數。
Scanf
2.如果我想輸出一行文字在螢幕上,我可以用那個函數。
Printf
3.if(a == 10)
if(b == 10)
if(c == 10)
d = a;
else
d = b;
請問第5行的else是對應到哪一行的if
3
4.if(a >=0)
{
    if(a <= 100)
    {
    }
}
請問上面的兩個if判斷可以用下列哪一個取代
if(a >= 0 && a <= 100)
5.下列哪一個不是C語言的迴圈
foreach
6.哪一個指令可以跳離最近的迴圈
break
7.下列哪些是合法的陣列宣告
int array[];
8.下列哪一個是陣列的第一個元素
array[0]
9.下列何者是正確的指標宣告,代表指向一個正整數的指標。
int *num;
10.num = &a;
如果a的型態是float
那num的型態可能是什麼
float *
11.'0' 跟 "0" 是一樣的
no
12.'1' + '2' == '3'
no
13.請問指標不能做下列哪種運算
/
14.程式片段如下
char str[]="1234";
printf("%d",strlen(str));
請問printf 會輸出什麼呢
4
15.哪個是可以用在struct變數間的運算子
=
16.請問以下struct的宣告是不是合法的
struct要加東西 {
   int a, b;
  char c, d;
} s1, s2;
不是

17.當我要開啟一個檔案用來做寫入的時候
怎樣的語法是對的
out = fopen(\"text.txt\", \"w\");
18.檔案只有一種類型
就是文字檔案
no

Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:108.162.216.229
©2016-2024

Related questions

4 like 0 dislike
0 answers
[Normal] Coding (C) - asked Nov 3, 2017 in Questions Bank by nat236919 (5.9k points)
ID: 30263 - Available when: Unlimited - Due to: Unlimited
| 208 views
4 like 0 dislike
1 answer
[Normal] Coding (C) - asked Nov 3, 2017 in Questions Bank by nat236919 (5.9k points)
ID: 30261 - Available when: Unlimited - Due to: Unlimited
| 347 views
12,783 questions
183,443 answers
172,219 comments
4,824 users