首页 > 编程语言 > 详细

实验1c语言开发环境使用和数据类型,运算符和表达式

时间:2019-10-20 15:29:55      阅读:52      评论:0      收藏:0      [点我收藏+]
/*this is first c program*/
# include<stdio.h>
int main()
{
    printf("Hello Mars!");
    return 0;
}
#include<stdio.h>
int product(int,int);
int main (void)
{
    int x,y,s;
    scanf("%d%d",&x,&y);
    s=product(x,y);
    printf("The mul is :%d",s);
    return 0;
}
int product(int a,int b)
{
    int mul;
    mul=a*b;
    return mul;
}
#include <stdio.h>
int main()
{
    int a=5,b=7,c=100,d,e,f;
    d=a/b*c;
    e=a*c/b;
    f=c/b*a;
    printf("d=%d,e=%e,f=%d\n",d,e,f);
    return 0;
    
}
#include<stdio.h>
int main()
{
    int a=5,b=8;
    printf("a++=%d\n",a++);
    printf("a=%d\n",a);
    printf("++b=%d\n,++b");
    printf("b=%d\n",b);
    return 0;
}
#include<stdio.h>
int main()
{
    int a=5 ,b=8,c=8;
    printf("%d,%d,%d,%d\n",a==b&&a==c,a!=b&&a!=c,a>=c,a<=b&&a<=c);
   printf("%d,%d\n",a<=b||a>=c,a==b||b==c);
   printf("%D,%d,%d,%d\n",!(a==b),!(a>=c),!(a<=b));
   return 0;
}
#include<stdio.h>
int main ()
{
    int x;
    printf("输入一个整数\n");
    scanf("%d",&x);
    
    if(x%2==0)
        printf("是偶数\n");
    else
    
    printf("是奇数\n");
    return 0 ;
}
#include<stdio.h>
int main(){
    char ch;
    printf("输入一个字符:\n");
    scanf("%c",&ch);
    if(ch<=z&&ch>=a)
    printf("%c-->%c",ch,ch-32) ;
    else
    printf("%c不是小写字母\n",ch);
}

技术分享图片技术分享图片技术分享图片技术分享图片技术分享图片技术分享图片技术分享图片技术分享图片

实验1c语言开发环境使用和数据类型,运算符和表达式

原文:https://www.cnblogs.com/dfe2fe42fw/p/11707455.html

(1)
(1)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!