当前位置:网站首页>Chapter 2 programming exercises
Chapter 2 programming exercises
2020-11-08 16:17:00 【Wang Jing】
Chapter 2 programming exercises 1. Print name
#define NAME"Billie"
#define SURNAME"Eilish"
int main(void)
{
printf("%s %s\n",NAME,SURNAME);
printf("%s\n %s\n",NAME,SURNAME);
printf("%s",NAME);
printf("%s\n",SURNAME);
return 0;
}
2. Print name and address
#define NAME"Halsey"
#define ADDRESS"Washington,New Jersey,USA"
int main(void)
{
printf("%s\n",NAME);
printf("%s\n",ADDRESS);
return 0;
}```
3. Age and days
```#include <stdio.h>
int main(void)
{
int age,day;
age=17;
day=17*365;
printf("my age=%d days=%d",age,day);
return 0;
}```
4. Output jolly deny
```#include <stdio.h>
int jolly(void);
int deny(void);
int main(void){
jolly();
jolly();
jolly();
deny();
return 0;
}
int jolly(void){
printf("For he's a jolly good fellow!\n");
return 0;
}
int deny(void){
printf("Which nobody can deny!\n");
return 0;/*wj*/
}```
5. Output bric
```#include <stdio.h>
int br(void);
int ic(void);
int main(void){
br();
printf(",");
ic();
printf(",\n");
br();
printf("\n");
return 0;
}
int br(void){
printf("Brazil,Russia");
return 0;
}
int ic(void)
{
printf("India,China");
return 0;//wj
}```
6. Calculation toes
```#include <stdio.h>
int main(void){
int toes;
toes=10;
printf("The Variablem toes=%d.\n",toes);
printf("donble toes=%d.\n",2*toes);
printf("toes'square=%d.\n",toes*toes);
return 0;
}```
7.smile
```int smile(void);
#include <stdio.h>
int main(void) {
smile();smile();smile();
printf("\n");
smile;smile;
printf("\n");
smile;
printf("n");
return 0;
}
int smile(void){
printf("smile!");
return 0;
}```
8.one-three
```#include <stdio.h>
int one_three(void);
int two(void);
int main(void){
printf("Starting now:\n");
one_three();
printf("Done!\n");
return 0;
}
int one_three(void){
printf("one\n");
two();
printf("three\n");
return 0;
}
int two(void){
printf("two\n");
return 0;
}```
版权声明
本文为[Wang Jing]所创,转载请带上原文链接,感谢
边栏推荐
- I used Python to find out all the people who deleted my wechat and deleted them automatically
- Returning to the third place in the world, what did Xiaomi do right?
- Liteos message queuing actual combat
- .NET 大数据量并发解决方案
- Millet and oppo continue to soar in the European market, and Xiaomi is even closer to apple
- LiteOS-消息队列-实战
- markdown使用
- 模板引擎的整理归纳
- Awk implements SQL like join operation
- What is forsage Ethereum smart contract? What is the global decline of Ethereum
猜你喜欢

一分钟全面看懂forsage智能合约全球共享以太坊矩阵计划

What is forsage Ethereum smart contract? What is the global decline of Ethereum

京东落地DevOps平台时爆发的冲突如何解决?

Is there no way out for older programmers?

我用 Python 找出了删除我微信的所有人并将他们自动化删除了

Liteos message queuing
![[open source]. Net uses ORM to access Huawei gaussdb database](/img/f8/50715c25a9d49b010cba2ff442c04e.jpg)
[open source]. Net uses ORM to access Huawei gaussdb database

总结: 10月海外DeFi新项目,更多资管策略来了!

write文件一个字节后何时发起写磁盘IO

二叉树的四种遍历方应用
随机推荐
Talking about, check the history of which famous computer viruses, 80% of the people do not know!
Framework - SPI four modes + general device driver implementation - source code
Solution of DEV-C + + unable to debug in Windows Environment
别再在finally里面释放资源了,解锁个新姿势!
Recurrence of Apache kylin Remote Code Execution Vulnerability (cve-2020-1956)
Examples of unconventional aggregation
小米、OPPO在欧洲市场继续飙涨,小米更是直逼苹果
Alibaba cloud accelerates its growth and further consolidates its leading edge
LeanCloud 十月变化
The network adapter could not establish the connection
Arduino IDE搭建ESP8266开发环境,文件下载过慢解决方法 | ESP-01制作WiFi开关教程,改造宿舍灯
Solution to the problem of offline connection between ADB and mobile phone
[开源] .Net 使用 ORM 访问 华为GaussDB数据库
小青台正式踏上不归路的第3天
The birth of a new integrated memory and computing chip is conducive to the application of artificial intelligence~
VIM configuration tutorial + source code
PHP生成唯一字符串
Golang ICMP Protocol detects viable hosts
c++ opencv4.3 sift匹配
Use markdown