A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© jjw4896774 中级黑马   /  2015-10-27 23:37  /  832 人查看  /  1 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

语言程序.c
  
  需求:在控制台打印Hello World!
编写代码,编译成汇编语言程序 命令:cc -c 文件名(注意:一定进入这个文件的目录)链接编译成机器语言程序 命令:cc 文件名

#include <stdio.h>

//让一个整数与10相加
int hello2(int a){
    printf("hello World---2!\n");
    return 10+a;
}

int hello1(){
    printf("hello World---1!\n");
    printf("hello World---1-2!\n");
    printf("hello World---1-3!\n");
    int a=2;
    hello2(a);
    return 0;
}

int main(){
    printf("hello World!\n");
    hello1();//打印3行hello world;
   // hello1();
    //int a=2;
   // hello2(a);
    return 0;
}

1 个回复

倒序浏览
千里之行,始于足下
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马