C语言程序简单例子.doc
丹烟****魔王
亲,该文档总共21页,到这已经超出免费预览范围,如果喜欢就直接下载吧~
相关资料
C语言程序简单例子.doc
实验二参考答案1.输入两个整型数字,输出他们的和。#include<stdio.h>main(){inta,b,sum;scanf(“%d%d”,&a,&b);sum=a+b;printf(“a+b=%d”,sum);}2.输入两个实型数,输出他们的和与乘积。#include<stdio.h>main(){floata,b,sum,product;scanf(“%f%f”,&a,&b);sum=a+b;product=a*b;printf(“a+b=%5.2f,a*b=%5.2f”,sum,product
C语言程序简单例子.doc
.实用文档.实验二参考答案1.输入两个整型数字,输出他们的和。#include<stdio.h>main(){inta,b,sum;scanf(“%d%d〞,&a,&b);sum=a+b;printf(“a+b=%d〞,sum);}2.输入两个实型数,输出他们的和与乘积。#include<stdio.h>main(){floata,b,sum,product;scanf(“%f%f〞,&a,&b);sum=a+b;product=a*b;printf(“a+b=%f,a*b=%f〞,sum,product
简单C语言程序的例子.doc
例子:#include<stdio.h>main(){tips();/*caller*/printf(“\nSuccessisaboutbangingonafterothershaveletgo”);}tips()/*caller*/{printf(“\nWhenyoureachtheendoftheropetieaknot&hangon”,)0;}[上述程序的输出结果如下:Whenyoureachtheendoftheropttieaknot&hangon.Successisabouthangingon
C语言程序简单例子.doc
.实用文档.实验二参考答案1.输入两个整型数字,输出他们的和。#include<stdio.h>main(){inta,b,sum;scanf(“%d%d〞,&a,&b);sum=a+b;printf(“a+b=%d〞,sum);}2.输入两个实型数,输出他们的和与乘积。#include<stdio.h>main(){floata,b,sum,product;scanf(“%f%f〞,&a,&b);sum=a+b;product=a*b;printf(“a+b=%f,a*b=%f〞,sum,product
简单C语言程序的例子.doc
..-..word.zl-例子:#include<stdio.h>main(){tips();/*caller*/printf(“\nSuccessisaboutbangingonafterothershaveletgo〞);}tips()/*caller*/{printf(“\nWhenyoureachtheendoftheropetieaknot&hangon〞,)0;}[上述程序的输出结果如下:Whenyoureachtheendoftheropttieaknot&hangon.Successisa