11 – Convert lower case to upper case or upper case to lower case• Write a program that inputs a character using ASCII table to convert lower case to upper case or upper case to lower case• Input a character repeatedly using the While statement• Hint1 : fflush(stdin);• Hint2 : The difference between A and a is 32• Use the getchar() and putchar()
7条回答 默认 最新
- 软件破坏专家 2015-10-17 04:42关注
#include
void main()
{
char x='a';
printf("Input Alphabet:");
scanf("%c",&x);
if( x>='A' && x<='Z')
{x=x+32;
printf("Result : %c\n",x);
}
else if( x>='a' && x<='z')
{
x=x-32;
printf("Result : %c\n",x);
}else
printf("Wrong input ! try again");
}解决 无用评论 打赏 举报
悬赏问题
- ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
- ¥15 lammps拉伸应力应变曲线分析
- ¥15 C++ 头文件/宏冲突问题解决
- ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
- ¥50 安卓adb backup备份子用户应用数据失败
- ¥20 有人能用聚类分析帮我分析一下文本内容嘛
- ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
- ¥30 python代码,帮调试,帮帮忙吧
- ¥15 #MATLAB仿真#车辆换道路径规划
- ¥15 java 操作 elasticsearch 8.1 实现 索引的重建