当前位置:网站首页>C language: examples of logical operation and judgment selection structure
C language: examples of logical operation and judgment selection structure
2022-07-02 03:47:00 【Nianchi ichthyology programming】
#include <stdio.h>
int main()
{
int x , m , n;
int sum = 0;
printf(" Please enter a number (1-10000)");
scanf("%d",&x);
switch(x%2){
case 0:{
printf(" Please enter two integers :");
scanf("%d%d",&m,&n);
sum = m+n;
printf("%d and %d And for :%d\n",m,n,sum);
break;
}
default:{
printf(" Please enter two integers :");
scanf("%d%d",&m,&n);
sum = m-n;
printf("%d and %d And for :%d\n",m,n,sum);
break;
}
}
return 0;
}
边栏推荐
- Unity脚本的基础语法(7)-成员变量和实例化
- Gradle foundation | customize the plug-in and upload it to jitpack
- 初识string+简单用法(二)
- 软件测试人的第一个实战项目:web端(视频教程+文档+用例库)
- The 6th Blue Bridge Cup single chip microcomputer provincial competition
- WPViewPDF Delphi 和 .NET 的 PDF 查看组件
- 蓝桥杯单片机省赛第十一届
- 蓝桥杯单片机省赛第十二届第一场
- Object oriented thinking
- 蓝桥杯单片机省赛第十一届第二场
猜你喜欢
C语言:逻辑运算和判断选择结构例题
"Analysis of 43 cases of MATLAB neural network": Chapter 41 implementation of customized neural network -- personalized modeling and Simulation of neural network
MD5 of Oracle
蓝桥杯单片机省赛第十一届
Influence of air resistance on the trajectory of table tennis
Homework in Chapter 3 of slam course of dark blue vision -- derivative application of T6 common functions
蓝桥杯单片机省赛第八届
蓝桥杯单片机省赛第十一届第二场
[Li Kou brush questions] 15 Sum of three numbers (double pointer); 17. Letter combination of phone number (recursive backtracking)
蓝桥杯单片机省赛第十届
随机推荐
FFMpeg AVFrame 的概念.
Introduction to Robotics II. Forward kinematics, MDH method
Kotlin basic learning 16
How about Ping An lifetime cancer insurance?
Pandora IOT development board learning (HAL Library) - Experiment 2 buzzer experiment (learning notes)
近段时间天气暴热,所以采集北上广深去年天气数据,制作可视化图看下
0 foundation how to learn automated testing? Follow these seven steps step by step and you will succeed
Interface debugging tool simulates post upload file - apipost
Kotlin basic learning 17
Oracle common SQL
蓝桥杯单片机省赛第八届
【IBDFE】基于IBDFE的频域均衡matlab仿真
Analyse de 43 cas de réseaux neuronaux MATLAB: Chapitre 42 opérations parallèles et réseaux neuronaux - - opérations parallèles de réseaux neuronaux basées sur CPU / GPU
Vite: scaffold assembly
Is the product of cancer prevention medical insurance safe?
滴滴开源DELTA:AI开发者可轻松训练自然语言模型
Account management of MySQL
Jetpack之LiveData扩展MediatorLiveData
The second game of the 12th provincial single chip microcomputer competition of the Blue Bridge Cup
蓝桥杯单片机数码管技巧