本文主要是介绍学习笔记(55):C语言入门到精通-赋值算符,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
立即学习:https://edu.csdn.net/course/play/10534/378140?utm_source=blogtoedu
#include <stdio.h>void print_ret(const char* str, const int c) {printf("%s = %d\n", str, c);
}int main() {int a = 0;int b = 0;int t = 0;printf("Please input a and b: ");scanf("%d%d", &a, &b);t = a;print_ret("a + b", a + b);print_ret("a += b", a += b);a = t;print_ret("a -= b", a -= b);a = t;print_ret("a *= b", a *= b);a = t;print_ret("a /= b", a /= b);a = t;print_ret("a %= b", a %= b);a = t;print_ret("a <<= b", a <<= b);a = t;print_ret("a >>= b", a >>= b);a = t;print_ret("a &= b", a &= b);a = t;print_ret("a |= b", a |= b);a = t;print_ret("a ^= b", a ^= b);return 0;
}
这篇关于学习笔记(55):C语言入门到精通-赋值算符的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!