当前位置:网站首页>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;
}
边栏推荐
- [mv-3d] - multi view 3D target detection network
- Interface debugging tool simulates post upload file - apipost
- Monkey测试
- The 6th Blue Bridge Cup single chip microcomputer provincial competition
- Influence of air resistance on the trajectory of table tennis
- Gradle foundation | customize the plug-in and upload it to jitpack
- leetcode-1380. Lucky number in matrix
- Visual slam Lecture 3 -- Lie groups and Lie Algebras
- Custom classloader that breaks parental delegation
- Vite: configure IP access
猜你喜欢

蓝桥杯单片机省赛第十一届

高性能 低功耗Cortex-A53核心板 | i.MX8M Mini

Lost a few hairs, and finally learned - graph traversal -dfs and BFS

【小技巧】使用matlab GUI以对话框模式读取文件

Review materials of project management PMP high frequency examination sites (8-1)

《MATLAB 神经网络43个案例分析》:第42章 并行运算与神经网络——基于CPU/GPU的并行神经网络运算

Influence of air resistance on the trajectory of table tennis

Eight steps of agile development process

Get started with Aurora 8b/10b IP core in one day (5) -- learn from the official routine of framing interface

Didi open source Delta: AI developers can easily train natural language models
随机推荐
[personal notes] PHP common functions - custom functions
Custom classloader that breaks parental delegation
Monkey测试
Oracle viewing locked tables and unlocking
蓝桥杯单片机省赛第七届
Qt的网络连接方式
Lost a few hairs, and finally learned - graph traversal -dfs and BFS
[wireless image transmission] FPGA based simple wireless image transmission system Verilog development, matlab assisted verification
Basic syntax of unity script (7) - member variables and instantiation
Oracle的md5
潘多拉 IOT 开发板学习(HAL 库)—— 实验2 蜂鸣器实验(学习笔记)
Basic syntax of unity script (8) - collaborative program and destruction method
Eight steps of agile development process
SQL Yiwen get window function
Qt插件之Qt Designer插件实现
How about Ping An lifetime cancer insurance?
蓝桥杯单片机省赛第六届
First acquaintance with string+ simple usage (II)
2022-07-01:某公司年会上,大家要玩一食发奖金游戏,一共有n个员工, 每个员工都有建设积分和捣乱积分, 他们需要排成一队,在队伍最前面的一定是老板,老板也有建设积分和捣乱积分, 排好队后,所有
蓝桥杯单片机第四届省赛