{"id":5451,"date":"2024-12-18T12:00:47","date_gmt":"2024-12-18T03:00:47","guid":{"rendered":"https:\/\/www.bold.ne.jp\/engineer-club\/?p=5451"},"modified":"2025-12-19T12:48:54","modified_gmt":"2025-12-19T03:48:54","slug":"c-language-operators","status":"publish","type":"post","link":"https:\/\/www.bold.ne.jp\/engineer-club\/c-language-operators","title":{"rendered":"\uff23\u8a00\u8a9e\u306e\u6f14\u7b97\u5b50\u3068\u306f\u3000\uff5e\u6f14\u7b97\u5b50\u306e\u7a2e\u985e\u3068\u512a\u5148\u9806\u4f4d\uff5e"},"content":{"rendered":"<p>\uff23\u8a00\u8a9e\u306e\u6f14\u7b97\u5b50\u3068\u306f\u3001\u5909\u6570\u3084\u5b9a\u6570\u306e\u64cd\u4f5c\u3001\u8a08\u7b97\u3092\u884c\u3046\u305f\u3081\u306e\u8a18\u53f7\u3067\u3059\u3002\u6f14\u7b97\u5b50\u306b\u306f\u512a\u5148\u9806\u4f4d\u304c\u3042\u308a\u3001\u5909\u6570\u306e\u5de6\u53f3\u3069\u3061\u3089\u306b\u8a18\u8ff0\u3059\u308b\u304b\u306b\u3088\u3063\u3066\u610f\u5473\u304c\u5909\u308f\u308b\u306a\u3069\u3001\u3088\u304f\u4f7f\u3046\u3082\u306e\u3067\u306f\u3042\u308a\u307e\u3059\u304c\u3001\u4f7f\u3044\u65b9\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u4e3b\u306a\u6f14\u7b97\u5b50\u306e\u7a2e\u985e\u3068\u305d\u306e\u4f7f\u3044\u65b9\u3092\u89e3\u8aac\u3057\u3001\u6f14\u7b97\u304c\u884c\u308f\u308c\u308b\u969b\u306e\u512a\u5148\u9806\u4f4d\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">\u76ee\u6b21<\/p><ul class=\"toc_list\"><li><a href=\"#i\">\uff11\uff0e\uff23\u8a00\u8a9e \u6f14\u7b97\u5b50\u306e\u7a2e\u985e<\/a><ul><li><a href=\"#i-2\">\uff11-\uff11\uff0e\u6f14\u7b97\u5b50\u4e00\u89a7<\/a><\/li><li><a href=\"#i-3\">\uff11-\uff12\uff0e\u7b97\u8853\u6f14\u7b97\u5b50<\/a><\/li><li><a href=\"#i-4\">\uff11-\uff13\uff0e\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30c8\/\u30c7\u30af\u30ea\u30e1\u30f3\u30c8\u6f14\u7b97\u5b50<\/a><\/li><li><a href=\"#i-5\">\uff11-\uff14\uff0e\u6bd4\u8f03\u6f14\u7b97\u5b50<\/a><\/li><li><a href=\"#i-6\">\uff11-\uff15\uff0e\u8ad6\u7406\u6f14\u7b97\u5b50<\/a><\/li><li><a href=\"#i-7\">\uff11-\uff16\uff0e\u30d3\u30c3\u30c8\/\u30b7\u30d5\u30c8\u6f14\u7b97\u5b50<\/a><\/li><li><a href=\"#i-8\">\uff11-\uff17\uff0e\u4ee3\u5165\u6f14\u7b97\u5b50<\/a><\/li><li><a href=\"#i-9\">\uff11-\uff18\uff0e\u305d\u306e\u4ed6\u306e\u6f14\u7b97\u5b50<\/a><\/li><\/ul><\/li><li><a href=\"#i-10\">\uff12\uff0e\uff23\u8a00\u8a9e \u6f14\u7b97\u5b50\u306e\u512a\u5148\u9806\u4f4d<\/a><\/li><li><a href=\"#i-11\">\uff13\uff0e\u3055\u3044\u3054\u306b<\/a><\/li><\/ul><\/div>\n<h2><span id=\"i\">\uff11\uff0e\uff23\u8a00\u8a9e \u6f14\u7b97\u5b50\u306e\u7a2e\u985e<\/span><\/h2>\n<p>\u6f14\u7b97\u5b50\u306b\u306f\u591a\u304f\u306e\u7a2e\u985e\u304c\u3042\u308a\u3001\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3059\u308b\u3068\u5909\u6570\u3084\u5b9a\u6570\u306b\u5bfe\u3057\u3066\u3055\u307e\u3056\u307e\u306a\u6f14\u7b97\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3><span id=\"i-2\">\uff11-\uff11\uff0e\u6f14\u7b97\u5b50\u4e00\u89a7<\/span><\/h3>\n<p>\u672c\u8a18\u4e8b\u3067\u89e3\u8aac\u3059\u308b<span>C<\/span>\u8a00\u8a9e\u306e\u6f14\u7b97\u5b50\u3092\u8868<span>1<\/span>\u306b\u307e\u3068\u3081\u307e\u3057\u305f\u3002\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3059\u308b\u969b\u306e\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<table style=\"border-collapse: collapse; width: 100%; height: 168px;\">\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"width: 50%; height: 24px;\">\u6f14\u7b97\u5b50\u306e\u7a2e\u985e<\/td>\n<td style=\"width: 50%; height: 24px;\">\u6f14\u7b97\u5b50<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 50%; height: 24px;\">\u7b97\u8853\u6f14\u7b97\u5b50<\/td>\n<td style=\"width: 50%; height: 24px;\">+,-,*,\/,%,<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 50%; height: 24px;\">\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30c8<span>\/<\/span>\u30c7\u30af\u30ea\u30e1\u30f3\u30c8\u6f14\u7b97\u5b50<\/td>\n<td style=\"width: 50%; height: 24px;\">++,&#8211;<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 50%; height: 24px;\">\u6bd4\u8f03\u6f14\u7b97\u5b50<\/td>\n<td style=\"width: 50%; height: 24px;\">&gt;,&gt;=,&lt;,&lt;=,==,!=<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 50%; height: 24px;\">\u8ad6\u7406\u6f14\u7b97\u5b50<\/td>\n<td style=\"width: 50%; height: 24px;\">!,&amp;&amp;,||<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 50%; height: 24px;\">\u30d3\u30c3\u30c8<span>\/<\/span>\u30b7\u30d5\u30c8\u6f14\u7b97\u5b50<\/td>\n<td style=\"width: 50%; height: 24px;\">~,&amp;,|,^,&lt;&lt;,&gt;&gt;<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 50%; height: 24px;\">\u4ee3\u5165\u6f14\u7b97\u5b50<\/td>\n<td style=\"width: 50%; height: 24px;\">=,+=,-=,*=,\/=,%=,&amp;=,|=,^=,&lt;&lt;=,&gt;&gt;=<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"text-align: center;\">\u8868<span>1. <\/span>\u6f14\u7b97\u5b50\u4e00\u89a7<\/p>\n<h3><span id=\"i-3\">\uff11-\uff12\uff0e\u7b97\u8853\u6f14\u7b97\u5b50<\/span><\/h3>\n<p>\u7b97\u8853\u6f14\u7b97\u5b50\u306f\u3001<span>2<\/span>\u3064\u306e\u5024\u306e\u52a0\u7b97\u3001\u6e1b\u7b97\u3001\u4e57\u7b97\u3001\u9664\u7b97\u306e\u56db\u5247\u6f14\u7b97\u3068\u9664\u7b97\u306e\u4f59\u308a\u3092\u6c42\u3081\u308b\u5270\u4f59\u7b97\u3092\u884c\u3046\u305f\u3081\u306e\u6f14\u7b97\u5b50\u3067\u3059\u3002\u8868<span>2<\/span>\u306f\u7b97\u8853\u6f14\u7b97\u5b50\u306e\u4e00\u89a7\u3067\u3059\u3002<\/p>\n<table style=\"border-collapse: collapse; width: 100%; height: 144px;\">\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">\u6f14\u7b97\u5b50<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u8a18\u8ff0\u4f8b<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u8aac\u660e<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">+<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">a + b<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u52a0\u7b97<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">&#8211;<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">a &#8211; b<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u6e1b\u7b97<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">*<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">a * b<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u4e57\u7b97<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">\/<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">a \/ b<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u9664\u7b97<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">%<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">a % b<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u5270\u4f59\u7b97<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"text-align: center;\">\u8868<span>2. <\/span>\u7b97\u8853\u6f14\u7b97\u5b50\u4e00\u89a7<\/p>\n<p>\u7b97\u8853\u6f14\u7b97\u5b50\u3092\u4f7f\u3063\u3066\u6f14\u7b97\u3092\u884c\u3046\u4f8b\u3092\u4ee5\u4e0b\u306b\u793a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">#include \r\n\r\nint main(void){\r\n    int a, b, ans;\r\n\r\n    a = 7;\r\n   b = 2;\r\n\r\n    ans = a + b;\r\n    printf(\u201c%d\\n\u201d, ans);\r\n\r\n    ans = a - b;\r\n    printf(\u201c%d\\n\u201d, ans);\r\n\r\n    ans = a * b;\r\n    printf(\u201c%d\\n\u201d, ans);\r\n\r\n    ans = a \/ b;\r\n    printf(\u201c%d\\n\u201d, ans);\r\n\r\n    ans = a % b;\r\n    printf(\u201c%d\\n\u201d, ans);\r\n\r\n    return 0;\r\n}<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">9\r\n5\r\n14\r\n3\r\n1<\/pre>\n<p>\u9664\u7b97\u306e\u7d50\u679c\u304c<span>3<\/span>\u3068\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<span>int<\/span>\u578b\u3069\u3046\u3057\u3067\u6f14\u7b97\u3092\u884c\u3046\u3068\u7d50\u679c\u3082<span>int<\/span>\u578b\u3068\u306a\u308a\u3001\u5c0f\u6570\u70b9\u4ee5\u4e0b\u304c\u5207\u308a\u6368\u3066\u3089\u308c\u3066\u6574\u6570\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3><span id=\"i-4\">\uff11-\uff13\uff0e\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30c8<span>\/<\/span>\u30c7\u30af\u30ea\u30e1\u30f3\u30c8\u6f14\u7b97\u5b50<\/span><\/h3>\n<p>\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30c8\u3068\u306f\u5024\u306b<span>1<\/span>\u3092\u52a0\u7b97\u3059\u308b\u3053\u3068\u3001\u30c7\u30af\u30ea\u30e1\u30f3\u30c8\u3068\u306f\u5024\u304b\u3089<span>1<\/span>\u3092\u6e1b\u7b97\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30c8<span>\/<\/span>\u30c7\u30af\u30ea\u30e1\u30f3\u30c8\u6f14\u7b97\u5b50\u306f<span>for<\/span>\u6587\u3084<span>while<\/span>\u6587\u3067\u7e70\u308a\u8fd4\u3057\u884c\u3046\u51e6\u7406\u3092\u8a18\u8ff0\u3059\u308b\u5834\u5408\u306a\u3069\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002\u8868<span>3<\/span>\u306f\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30c8<span>\/<\/span>\u30c7\u30af\u30ea\u30e1\u30f3\u30c8\u6f14\u7b97\u5b50\u306e\u4e00\u89a7\u3067\u3059\u3002<\/p>\n<table style=\"border-collapse: collapse; width: 100%; height: 72px;\">\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">\u6f14\u7b97\u5b50<\/td>\n<td style=\"width: 27.6705%; height: 24px;\">\u8a18\u8ff0\u4f8b<\/td>\n<td style=\"width: 38.9961%; height: 24px;\">\u8aac\u660e<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">++<\/td>\n<td style=\"width: 27.6705%; height: 24px;\">++a\uff0ca++<\/td>\n<td style=\"width: 38.9961%; height: 24px;\">\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30c8<span>(1<\/span>\u52a0\u7b97\u3059\u308b<span>)<\/span><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">&#8212;<\/td>\n<td style=\"width: 27.6705%; height: 24px;\">&#8211;a\uff0ca&#8211;<\/td>\n<td style=\"width: 38.9961%; height: 24px;\">\u30c7\u30af\u30ea\u30e1\u30f3\u30c8<span>(1<\/span>\u6e1b\u7b97\u3059\u308b<span>)<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"text-align: center;\">\u8868<span>3. <\/span>\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30c8<span>\/<\/span>\u30c7\u30af\u30ea\u30e1\u30f3\u30c8\u6f14\u7b97\u5b50\u4e00\u89a7<\/p>\n<p>\u5909\u6570\u306e\u524d\u306b\u6f14\u7b97\u5b50\u3092\u8a18\u8ff0\u3059\u308b\u5834\u5408\u3092\u524d\u7f6e\u3001\u5f8c\u306b\u6f14\u7b97\u5b50\u3092\u8a18\u8ff0\u3059\u308b\u5834\u5408\u3092\u5f8c\u7f6e\u3068\u547c\u3073\u307e\u3059\u3002\u524d\u7f6e\u3068\u5f8c\u7f6e\u306b\u3088\u308b\u9055\u3044\u306f\u5f8c\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<p>\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30c8<span>\/<\/span>\u30c7\u30af\u30ea\u30e1\u30f3\u30c8\u6f14\u7b97\u5b50\u3092\u4f7f\u3063\u3066\u6f14\u7b97\u3092\u884c\u3046\u4f8b\u3092\u4ee5\u4e0b\u306b\u793a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">#include <stdio.h>\r\n\r\nint main(void){\r\n    int a, b, ans;\r\n\r\n    a = 7;\r\n    b = 2;\r\n\r\n    ans = ++a;\r\n    printf(\u201c%d,%d\\n\u201d, ans, a);\r\n\r\n    ans = --b;\r\n    printf(\u201c%d,%d\\n\u201d, ans, b);\r\n\r\n    ans = a++;\r\n    printf(\u201c%d,%d\\n\u201d, ans, a);\r\n\r\n    ans = b--;\r\n    printf(\u201c%d,%d\\n\u201d, ans, b);\r\n\r\n    return 0;\r\n}<\/stdio.h><\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">8,8\r\n1,1\r\n8,9\r\n1,0<\/pre>\n<p>\u524d\u7f6e\u3068\u5f8c\u7f6e\u3067\u306f\u6f14\u7b97\u306e\u9806\u756a\u304c\u5909\u308f\u308a\u307e\u3059\u3002\u524d\u7f6e\u3067\u3082\u5f8c\u7f6e\u3067\u3082\u6700\u7d42\u7684\u306b\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30c8<span>\/<\/span>\u30c7\u30af\u30ea\u30e1\u30f3\u30c8\u304c\u884c\u308f\u308c\u307e\u3059\u304c\u3001\u524d\u7f6e\u306e\u5834\u5408\u306f\u5148\u306b\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30c8<span>\/<\/span>\u30c7\u30af\u30ea\u30e1\u30f3\u30c8\u3092\u3057\u3066\u304b\u3089\u4ee3\u5165\u3001\u5f8c\u7f6e\u306e\u5834\u5408\u306f\u5148\u306b\u4ee3\u5165\u3092\u3057\u3066\u304b\u3089\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30c8<span>\/<\/span>\u30c7\u30af\u30ea\u30e1\u30f3\u30c8\u304c\u884c\u308f\u308c\u307e\u3059\u3002<\/p>\n<h3><span id=\"i-5\">\uff11-\uff14\uff0e\u6bd4\u8f03\u6f14\u7b97\u5b50<\/span><\/h3>\n<p>\u6bd4\u8f03\u6f14\u7b97\u5b50\u306f\u3001<span>2<\/span>\u3064\u306e\u5024\u3092\u6bd4\u8f03\u3059\u308b\u305f\u3081\u306e\u6f14\u7b97\u5b50\u3067\u3059\u3002\u95a2\u4fc2\u6f14\u7b97\u5b50\u3068\u3082\u547c\u3070\u308c\u307e\u3059\u3002\u8868<span>4<\/span>\u306f\u6bd4\u8f03\u6f14\u7b97\u5b50\u306e\u4e00\u89a7\u3067\u3059\u3002<\/p>\n<table style=\"border-collapse: collapse; width: 100%; height: 168px;\">\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">\u6f14\u7b97\u5b50<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u8a18\u8f09\u4f8b<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">\u8aac\u660e<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">&gt;<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">a &gt; b<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">a\u306f<span>b<\/span>\u3088\u308a\u5927\u304d\u3044<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">&gt;=<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">a &gt;= b<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">a\u306f<span>b<\/span>\u4ee5\u4e0a<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">&lt;<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">a &lt; b<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">a\u306f<span>b<\/span>\u3088\u308a\u5c0f\u3055\u3044<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">&lt;=<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">a &lt;= b<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">a\u306f<span>b<\/span>\u4ee5\u4e0b<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">==<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">a == b<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">a\u306f<span>b<\/span>\u3068\u7b49\u3057\u3044<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 33.3333%; height: 24px;\">!=<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">a != b<\/td>\n<td style=\"width: 33.3333%; height: 24px;\">a\u306f<span>b<\/span>\u3068\u7b49\u3057\u304f\u306a\u3044<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"text-align: center;\">\u8868<span>4. <\/span>\u6bd4\u8f03\u6f14\u7b97\u5b50\u4e00\u89a7<\/p>\n<p>\u6bd4\u8f03\u6f14\u7b97\u5b50\u3092\u4f7f\u3063\u3066\u6f14\u7b97\u3092\u884c\u3046\u4f8b\u3092\u4ee5\u4e0b\u306b\u793a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">#include <stdio.h>\r\n\r\nint main(void){\r\nint a, b;\r\n\r\na = 5;\r\nb = 1;\r\n\r\nif(a &gt; 1) printf(\"TRUE\\n\");\r\n\r\nif(b &lt;= 1) printf(\"TRUE\\n\");\r\n\r\nif(a == 5) printf(\"TRUE\\n\");\r\n\r\nif(b != 5) printf(\"TRUE\\n\");\r\n\r\nreturn 0;\r\n}<\/stdio.h><\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">TRUE\r\nTRUE\r\nTRUE\r\nTRUE<\/pre>\n<p>\u5de6\u53f3\u304c\u7b49\u3057\u3044\u3053\u3068\u3092\u793a\u3059\u6bd4\u8f03\u6f14\u7b97\u5b50\u304c\u300c<span>=<\/span>\u300d\u3067\u306f\u306a\u304f\u3001\u300c<span>==<\/span>\u300d\u3067\u3042\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3><span id=\"i-6\">\uff11-\uff15\uff0e\u8ad6\u7406\u6f14\u7b97\u5b50<\/span><\/h3>\n<p>\u8ad6\u7406\u6f14\u7b97\u5b50\u306f\u3001\u6761\u4ef6\u5f0f\u306e<span>NOT(<\/span>\u5426\u5b9a<span>)<\/span>\u3001<span>AND(<\/span>\u8ad6\u7406\u7a4d<span>)<\/span>\u3001<span>OR(<\/span>\u8ad6\u7406\u548c<span>)<\/span>\u3092\u5f97\u308b\u305f\u3081\u306e\u6f14\u7b97\u5b50\u3067\u3059\u3002\u8868<span>5<\/span>\u306f\u8ad6\u7406\u6f14\u7b97\u5b50\u306e\u4e00\u89a7\u3067\u3059\u3002<\/p>\n<table style=\"border-collapse: collapse; width: 100%; height: 96px;\">\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"width: 22.1364%; height: 24px;\">\u6f14\u7b97\u5b50<\/td>\n<td style=\"width: 25.2252%; height: 24px;\">\u8a18\u8f09\u4f8b<\/td>\n<td style=\"width: 52.6383%; height: 24px;\">\u8aac\u660e<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 22.1364%; height: 24px;\">!<\/td>\n<td style=\"width: 25.2252%; height: 24px;\">!a<\/td>\n<td style=\"width: 52.6383%; height: 24px;\">NOT(\u8ad6\u7406\u5426\u5b9a<span>)<\/span><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 22.1364%; height: 24px;\">&amp;&amp;<\/td>\n<td style=\"width: 25.2252%; height: 24px;\">a &amp;&amp; b<\/td>\n<td style=\"width: 52.6383%; height: 24px;\">AND(\u8ad6\u7406\u7a4d<span>)<\/span><\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 22.1364%; height: 24px;\">||<\/td>\n<td style=\"width: 25.2252%; height: 24px;\">a || b<\/td>\n<td style=\"width: 52.6383%; height: 24px;\">OR(\u8ad6\u7406\u548c<span>)<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"text-align: center;\">\u8868<span>5. <\/span>\u8ad6\u7406\u6f14\u7b97\u5b50\u4e00\u89a7<\/p>\n<p>\u8ad6\u7406\u6f14\u7b97\u5b50\u3092\u4f7f\u3063\u3066\u6f14\u7b97\u3092\u884c\u3046\u4f8b\u3092\u4ee5\u4e0b\u306b\u793a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">#include <stdio.h>\r\n\r\nint main(void){\r\nint a, b;\r\n\r\na = 5;\r\nb = 1;\r\n\r\nif(!(a &lt; 1)) printf(\"TRUE\\n\");\r\n\r\nif(1 &lt; a &amp;&amp; a &lt; 10) printf(\"TRUE\\n\");\r\n\r\nif(1 &lt; a || 1 &lt; b) printf(\"TRUE\\n\");\r\n\r\nreturn 0;\r\n}<\/stdio.h><\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">TRUE\r\nTRUE\r\nTRUE<\/pre>\n<p>1\u756a\u76ee\u306e\u6761\u4ef6\u5f0f\u300c<span>a &lt; 1<\/span>\u300d\u3092\u300c<span>()<\/span>\u300d\u3067\u56f2\u3093\u3067\u3044\u307e\u3059\u304c\u3001\u3053\u308c\u306f\u6f14\u7b97\u5b50\u306e\u512a\u5148\u9806\u4f4d\u306b\u3088\u308b\u3082\u306e\u3067\u3059\u3002\u300c<span>()<\/span>\u300d\u3067\u56f2\u308f\u305a\u306b\u300c<span>!a &lt; 1<\/span>\u300d\u3068\u8a18\u8ff0\u3059\u308b\u3068\u3001\u300c<span>!a<\/span>\u300d\u306e\u8ad6\u7406\u6f14\u7b97\u304c\u5148\u306b\u884c\u308f\u308c\u3001\u305d\u306e\u7d50\u679c\u3068\u300c<span>&lt; 1<\/span>\u300d\u306e\u6bd4\u8f03\u6f14\u7b97\u304c\u884c\u308f\u308c\u307e\u3059\u3002\u6f14\u7b97\u5b50\u306e\u512a\u5148\u9806\u4f4d\u306b\u3064\u3044\u3066\u306f\u5f8c\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<h3><span id=\"i-7\">\uff11-\uff16\uff0e\u30d3\u30c3\u30c8<span>\/<\/span>\u30b7\u30d5\u30c8\u6f14\u7b97\u5b50<\/span><\/h3>\n<p>\u30d3\u30c3\u30c8\u6f14\u7b97\u5b50\u306f\u5024\u3092<span>2<\/span>\u9032\u6570<span>(0, 1<\/span>\u306e\u30d3\u30c3\u30c8\u5217<span>)<\/span>\u3068\u307f\u306a\u3057\u3066\u8ad6\u7406\u6f14\u7b97\u3092\u884c\u3046\u305f\u3081\u306e\u6f14\u7b97\u5b50\u3001\u30b7\u30d5\u30c8\u6f14\u7b97\u5b50\u306f\u5024\u3092<span>2<\/span>\u9032\u6570\u3068\u307f\u306a\u3057\u3066\u30d3\u30c3\u30c8\u3092\u5de6\u53f3\u306b\u79fb\u52d5\u3055\u305b\u308b<span>(<\/span>\u30b7\u30d5\u30c8\u6f14\u7b97<span>)<\/span>\u305f\u3081\u306e\u6f14\u7b97\u5b50\u3067\u3059\u3002\u8868<span>6<\/span>\u306f\u30d3\u30c3\u30c8<span>\/<\/span>\u30b7\u30d5\u30c8\u6f14\u7b97\u5b50\u306e\u4e00\u89a7\u3067\u3059\u3002<\/p>\n<table style=\"border-collapse: collapse; width: 100%;\">\n<tbody>\n<tr>\n<td style=\"width: 33.3333%;\">\u6f14\u7b97\u5b50<\/td>\n<td style=\"width: 26.7696%;\">\u8a18\u8ff0\u4f8b<\/td>\n<td style=\"width: 39.897%;\">\u8aac\u660e<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33.3333%;\">~<\/td>\n<td style=\"width: 26.7696%;\">~a<\/td>\n<td style=\"width: 39.897%;\">NOT(\u30d3\u30c3\u30c8\u53cd\u8ee2<span>)<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33.3333%;\">&amp;<\/td>\n<td style=\"width: 26.7696%;\">a &amp; b<\/td>\n<td style=\"width: 39.897%;\">AND(\u30d3\u30c3\u30c8\u8ad6\u7406\u548c<span>)<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33.3333%;\">|<\/td>\n<td style=\"width: 26.7696%;\">a | b<\/td>\n<td style=\"width: 39.897%;\">OR(\u30d3\u30c3\u30c8\u8ad6\u7406\u7a4d<span>)<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33.3333%;\">^<\/td>\n<td style=\"width: 26.7696%;\">a ^ b<\/td>\n<td style=\"width: 39.897%;\">XOR(\u30d3\u30c3\u30c8\u6392\u4ed6\u7684\u8ad6\u7406\u548c<span>)<\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33.3333%;\">&lt;&lt;<\/td>\n<td style=\"width: 26.7696%;\">a &lt;&lt; b<\/td>\n<td style=\"width: 39.897%;\">(b\u30d3\u30c3\u30c8<span>)<\/span>\u5de6\u30b7\u30d5\u30c8<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 33.3333%;\">&gt;&gt;<\/td>\n<td style=\"width: 26.7696%;\">a &gt;&gt; b<\/td>\n<td style=\"width: 39.897%;\">(b\u30d3\u30c3\u30c8<span>)<\/span>\u53f3\u30b7\u30d5\u30c8<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"text-align: center;\">\u8868<span>6. <\/span>\u30d3\u30c3\u30c8<span>\/<\/span>\u30b7\u30d5\u30c8\u6f14\u7b97\u5b50\u4e00\u89a7<\/p>\n<p>\u30d3\u30c3\u30c8<span>\/<\/span>\u30b7\u30d5\u30c8\u6f14\u7b97\u5b50\u3092\u4f7f\u3063\u3066\u6f14\u7b97\u3092\u884c\u3046\u4f8b\u3092\u4ee5\u4e0b\u306b\u793a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">#include <stdio.h>\r\n\r\nint main(void){\r\nint a, b, ans;\r\n\r\na = 2;\r\nb = 3;\r\n\r\nans = ~a;\r\nprintf(\"%d\\n\", ans);\r\n\r\nans = a &amp; b;\r\nprintf(\"%d\\n\", ans);\r\n\r\nans = a | b;\r\nprintf(\"%d\\n\", ans);\r\n\r\nans = a ^ b;\r\nprintf(\"%d\\n\", ans);\r\n\r\nans = a &lt;&lt; 1;\r\nprintf(\"%d\\n\", ans);\r\n\r\nans = a &gt;&gt; 1;\r\nprintf(\"%d\\n\", ans);\r\n\r\nreturn 0;\r\n}<\/stdio.h><\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">-3\r\n2\r\n3\r\n1\r\n4\r\n1<\/pre>\n<p>1\u756a\u76ee\u306e\u30d3\u30c3\u30c8\u53cd\u8ee2\u306e\u7d50\u679c\u304c\u8ca0\u306e\u6570\u306b\u306a\u308b\u306e\u306f\u3001<span>int<\/span>\u578b\u306e\u7b26\u53f7\u3092\u6c7a\u3081\u308b\u6700\u4e0a\u4f4d\u30d3\u30c3\u30c8<span>(MSB)<\/span>\u304c<span>0<\/span>\u304b\u3089<span>1<\/span>\u306b\u5909\u308f\u308b\u305f\u3081\u3067\u3059\u30025\u756a\u76ee\u306e\u5de6\u30b7\u30d5\u30c8\u3067\u306f\u3001\u5de6\u5074\u3067\u3042\u3075\u308c\u305f\u30d3\u30c3\u30c8\u306f\u524a\u9664\u3055\u308c\u3001\u53f3\u5074\u306b\u306f<span>0<\/span>\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u30026\u756a\u76ee\u306e\u53f3\u30b7\u30d5\u30c8\u3067\u306f\u3001\u53f3\u5074\u3067\u3042\u3075\u308c\u305f\u30d3\u30c3\u30c8\u306f\u524a\u9664\u3055\u308c\u3001\u5de6\u5074\u306b\u306f<span>0(0<\/span>\u307e\u305f\u306f\u6b63\u306e\u6570\u306e\u5834\u5408<span>)<\/span>\u307e\u305f\u306f<span>1(<\/span>\u8ca0\u306e\u6570\u306e\u5834\u5408<span>)<\/span>\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002<\/p>\n<h3><span id=\"i-8\">\uff11-\uff17\uff0e\u4ee3\u5165\u6f14\u7b97\u5b50<\/span><\/h3>\n<p>\u4ee3\u5165\u6f14\u7b97\u5b50\u306f\u3001\u5909\u6570\u306b\u5024\u3092\u4ee3\u5165\u3059\u308b\u305f\u3081\u306e\u6f14\u7b97\u5b50\u3067\u3059\u3002\u5358\u7d14\u306b\u5909\u6570\u306b\u5024\u3092\u4ee3\u5165\u3059\u308b\u3053\u3068\u306b\u52a0\u3048\u3001\u3053\u308c\u307e\u3067\u89e3\u8aac\u3057\u305f\u7b97\u8853\u6f14\u7b97\u3001\u30d3\u30c3\u30c8<span>\/<\/span>\u30b7\u30d5\u30c8\u6f14\u7b97\u3092\u884c\u3063\u305f\u4e0a\u3067\u4ee3\u5165\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u8868<span>5<\/span>\u306f\u4ee3\u5165\u6f14\u7b97\u5b50\u306e\u4e00\u89a7\u3067\u3059\u3002<\/p>\n<table style=\"border-collapse: collapse; width: 100%; height: 290px;\">\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"width: 15.4762%; height: 24px;\">\u6f14\u7b97\u5b50<\/td>\n<td style=\"width: 18.6937%; height: 24px;\">\u8a18\u8ff0\u4f8b<\/td>\n<td style=\"width: 21.7825%; height: 24px;\">\u540c\u3058\u610f\u5473\u306e\u5f0f<\/td>\n<td style=\"width: 44.0476%; height: 24px;\">\u8aac\u660e<\/td>\n<\/tr>\n<tr style=\"height: 26px;\">\n<td style=\"width: 15.4762%; height: 26px;\">=<\/td>\n<td style=\"width: 40.4762%; height: 26px;\" colspan=\"2\">a = b<\/td>\n<td style=\"width: 44.0476%; height: 26px;\">\u4ee3\u5165<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 15.4762%; height: 24px;\">+=<\/td>\n<td style=\"width: 18.6937%; height: 24px;\">a += b<\/td>\n<td style=\"width: 21.7825%; height: 24px;\">a = a + b<\/td>\n<td style=\"width: 44.0476%; height: 24px;\">\u52a0\u7b97\u3057\u3066\u4ee3\u5165<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 15.4762%; height: 24px;\">-=<\/td>\n<td style=\"width: 18.6937%; height: 24px;\">a -= b<\/td>\n<td style=\"width: 21.7825%; height: 24px;\">a = a &#8211; b<\/td>\n<td style=\"width: 44.0476%; height: 24px;\">\u6e1b\u7b97\u3057\u3066\u4ee3\u5165<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 15.4762%; height: 24px;\">*=<\/td>\n<td style=\"width: 18.6937%; height: 24px;\">a *= b<\/td>\n<td style=\"width: 21.7825%; height: 24px;\">a = a * b<\/td>\n<td style=\"width: 44.0476%; height: 24px;\">\u4e57\u7b97\u3057\u3066\u4ee3\u5165<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 15.4762%; height: 24px;\">\/=<\/td>\n<td style=\"width: 18.6937%; height: 24px;\">a \/= b<\/td>\n<td style=\"width: 21.7825%; height: 24px;\">a = a \/ b<\/td>\n<td style=\"width: 44.0476%; height: 24px;\">\u9664\u7b97\u3057\u3066\u4ee3\u5165<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 15.4762%; height: 24px;\">%=<\/td>\n<td style=\"width: 18.6937%; height: 24px;\">a %= b<\/td>\n<td style=\"width: 21.7825%; height: 24px;\">a = a % b<\/td>\n<td style=\"width: 44.0476%; height: 24px;\">\u5270\u4f59\u7b97\u3057\u3066\u4ee3\u5165<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 15.4762%; height: 24px;\">&amp;=<\/td>\n<td style=\"width: 18.6937%; height: 24px;\">a &amp;= b<\/td>\n<td style=\"width: 21.7825%; height: 24px;\">a = a &amp; b<\/td>\n<td style=\"width: 44.0476%; height: 24px;\">AND(\u30d3\u30c3\u30c8\u8ad6\u7406\u548c<span>)<\/span>\u306e\u7d50\u679c\u3092\u4ee3\u5165<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 15.4762%; height: 24px;\">|=<\/td>\n<td style=\"width: 18.6937%; height: 24px;\">a |= b<\/td>\n<td style=\"width: 21.7825%; height: 24px;\">a = a | b<\/td>\n<td style=\"width: 44.0476%; height: 24px;\">OR(\u30d3\u30c3\u30c8\u8ad6\u7406\u7a4d<span>)<\/span>\u306e\u7d50\u679c\u3092\u4ee3\u5165<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 15.4762%; height: 24px;\">^=<\/td>\n<td style=\"width: 18.6937%; height: 24px;\">a ^= b<\/td>\n<td style=\"width: 21.7825%; height: 24px;\">a = a ^ b<\/td>\n<td style=\"width: 44.0476%; height: 24px;\">XOR(\u30d3\u30c3\u30c8\u6392\u4ed6\u7684\u8ad6\u7406\u548c<span>)<\/span>\u306e\u7d50\u679c\u3092\u4ee3\u5165<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 15.4762%; height: 24px;\">&lt;&lt;=<\/td>\n<td style=\"width: 18.6937%; height: 24px;\">a &lt;&lt;= b<\/td>\n<td style=\"width: 21.7825%; height: 24px;\">a = a &lt;&lt; b<\/td>\n<td style=\"width: 44.0476%; height: 24px;\">\u5de6\u30b7\u30d5\u30c8\u3057\u3066\u4ee3\u5165<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 15.4762%; height: 24px;\">&gt;&gt;=<\/td>\n<td style=\"width: 18.6937%; height: 24px;\">a &gt;&gt;= b<\/td>\n<td style=\"width: 21.7825%; height: 24px;\">a = a &gt;&gt; b<\/td>\n<td style=\"width: 44.0476%; height: 24px;\">\u53f3\u30b7\u30d5\u30c8\u3057\u3066\u4ee3\u5165<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"text-align: center;\">\u88687<span>. <\/span>\u4ee3\u5165\u6f14\u7b97\u5b50\u4e00\u89a7<\/p>\n<h3><span id=\"i-9\">\uff11-\uff18\uff0e\u305d\u306e\u4ed6\u306e\u6f14\u7b97\u5b50<\/span><\/h3>\n<p>\u305d\u306e\u4ed6\u306e\u6f14\u7b97\u5b50\u3067\u3088\u304f\u4f7f\u3046\u3082\u306e\u3068\u3057\u3066\u3001<span>sizeof<\/span>\u6f14\u7b97\u5b50\u3068\u30ad\u30e3\u30b9\u30c8\u6f14\u7b97\u5b50\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<p>sizeof\u6f14\u7b97\u5b50\u306f\u3001\u5909\u6570\u3084\u30c7\u30fc\u30bf\u578b\u306e\u30e1\u30e2\u30ea\u30b5\u30a4\u30ba\u3092\u8abf\u3079\u308b\u305f\u3081\u306e\u6f14\u7b97\u5b50\u3067\u3059\u3002<span>sizeof<\/span>\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3059\u308b\u3068\u5909\u6570\u3084\u30c7\u30fc\u30bf\u578b\u306e\u30e1\u30e2\u30ea\u30b5\u30a4\u30ba\u3092\u30d0\u30a4\u30c8\u5358\u4f4d\u3067\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002sizeof\u6f14\u7b97\u5b50\u306f\u914d\u5217\u306e\u8981\u7d20\u6570\u3092\u8abf\u3079\u308b\u5834\u5408\u306a\u3069\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002\u8a73\u7d30\u306a\u4f7f\u3044\u65b9\u306f\u300c<span>C<\/span>\u8a00\u8a9e\u306e\u914d\u5217\u3068\u306f\u300d\u306e\u8a18\u4e8b\u3067\u89e3\u8aac\u3055\u308c\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u4f7f\u3044\u65b9\u3092\u77e5\u308a\u305f\u3044\u65b9\u306f\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u30ad\u30e3\u30b9\u30c8\u6f14\u7b97\u5b50\u306f\u3001\u30c7\u30fc\u30bf\u578b\u306e\u5909\u63db\u3092\u884c\u3046\u305f\u3081\u306e\u6f14\u7b97\u5b50\u3067\u3059\u3002<span>C<\/span>\u8a00\u8a9e\u3067\u306f\u6f14\u7b97\u306e\u904e\u7a0b\u3067\u6697\u9ed9\u7684\u306b\u30c7\u30fc\u30bf\u578b\u306e\u5909\u63db\u304c\u884c\u308f\u308c\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070\u4ee3\u5165\u6f14\u7b97\u5b50\u300c<span>=<\/span>\u300d\u3092\u4f7f\u3046\u969b\u306b\u5de6\u53f3\u306e\u30c7\u30fc\u30bf\u578b\u304c\u7570\u306a\u308b\u3068\u3001\u5de6\u8fba\u306e\u30c7\u30fc\u30bf\u578b\u306b\u5909\u63db\u3055\u308c\u307e\u3059\u3002\u4e00\u65b9\u3067\u660e\u793a\u7684\u306b\u30c7\u30fc\u30bf\u578b\u3092\u5909\u63db\u3057\u305f\u3044\u5834\u5408\u3001\u30ad\u30e3\u30b9\u30c8\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u30c7\u30fc\u30bf\u578b\u306e\u5909\u63db\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30ad\u30e3\u30b9\u30c8\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u30c7\u30fc\u30bf\u578b\u3092\u5909\u63db\u3057\u305f\u3044\u5909\u6570\u306e\u5de6\u5074\u306b\u30c7\u30fc\u30bf\u578b\u3092\u300c<span>()<\/span>\u300d\u3067\u56f2\u3093\u3067\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070<span>int<\/span>\u578b\u306e\u5909\u6570\u300c<span>a<\/span>\u300d\u3092<span>double<\/span>\u578b\u306b\u5909\u63db\u3059\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">(double)a<\/pre>\n<p>\u30ad\u30e3\u30b9\u30c8\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3057\u3066\u6f14\u7b97\u3092\u884c\u3046\u4f8b\u3092\u4ee5\u4e0b\u306b\u793a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">#include <stdio.h>\r\n\r\nint main(void){\r\n    int a, b;\r\n    double ans;\r\n\r\n    a = 7;\r\n    b = 2;\r\n\r\n    ans = a \/ b;\r\n    printf(\u201c%f\\n\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002\u201d, ans);\r\n\r\nans = a \/ (double)b;\r\nprintf(\u201c%f\\n\u201d, ans);\r\n\r\n    return 0;\r\n}<\/stdio.h><\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">3.000000\r\n3.500000<\/pre>\n<p>\uff11\uff0d\uff12\uff0e\u3067\u89e3\u8aac\u3057\u305f\u901a\u308a\u3001<span>int<\/span>\u578b\u306e\u307e\u307e\u9664\u7b97\u3092\u884c\u3046\u3068\u7d50\u679c\u3082<span>int<\/span>\u578b\u3068\u306a\u308b\u305f\u3081\u5c0f\u6570\u70b9\u4ee5\u4e0b\u304c\u5207\u308a\u6368\u3066\u3089\u308c\u307e\u3059\u304c\u3001\u30ad\u30e3\u30b9\u30c8\u6f14\u7b97\u5b50\u3067\u4e00\u65b9\u306e\u5909\u6570\u3092<span>double<\/span>\u578b\u306b\u5909\u63db\u3059\u308b\u3068\u3001\u9664\u7b97\u306e\u7d50\u679c\u306f<span>double<\/span>\u578b\u3068\u306a\u308a\u3001\u5c0f\u6570\u70b9\u4ee5\u4e0b\u3092\u8a08\u7b97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2><span id=\"i-10\">\uff12\uff0e\uff23\u8a00\u8a9e \u6f14\u7b97\u5b50\u306e\u512a\u5148\u9806\u4f4d<\/span><\/h2>\n<p>\u6f14\u7b97\u5b50\u306b\u306f\u512a\u5148\u9806\u4f4d\u304c\u3042\u308a\u3001\u5f0f\u306e\u4e2d\u306b\u8907\u6570\u306e\u6f14\u7b97\u5b50\u304c\u767b\u5834\u3057\u305f\u5834\u5408\u306f\u3001\u512a\u5148\u9806\u4f4d\u306b\u5f93\u3063\u3066\u6f14\u7b97\u304c\u884c\u308f\u308c\u307e\u3059\u3002\u56db\u5247\u6f14\u7b97\u3067\u52a0\u6e1b\u7b97\u3088\u308a\u3082\u4e57\u9664\u7b97\u3092\u5148\u306b\u884c\u3046\u3001\u5909\u6570\u3078\u306e\u4ee3\u5165\u306f\u53f3\u8fba\u306e\u8a08\u7b97\u3092\u884c\u3063\u3066\u304b\u3089\u4ee3\u5165\u3059\u308b\u3001\u3068\u3044\u3063\u305f\u9806\u756a\u3067\u6f14\u7b97\u3055\u308c\u308b\u306e\u306f\u3001\u3053\u306e\u6f14\u7b97\u5b50\u306e\u512a\u5148\u9806\u4f4d\u306b\u5f93\u3063\u3066\u3044\u308b\u305f\u3081\u3067\u3059\u3002<\/p>\n<p>\u5f0f\u306e\u4e2d\u306b\u540c\u3058\u512a\u5148\u9806\u4f4d\u306e\u6f14\u7b97\u5b50\u304c\u8907\u6570\u767b\u5834\u3057\u305f\u5834\u5408\u3001\u7d50\u5408\u898f\u5247\u3068\u3044\u3046\u8003\u3048\u65b9\u306b\u5f93\u3063\u3066\u6f14\u7b97\u304c\u884c\u308f\u308c\u307e\u3059\u3002\u7d50\u5408\u898f\u5247\u306f\u512a\u5148\u9806\u4f4d\u3054\u3068\u306b\u6c7a\u307e\u3063\u3066\u304a\u308a\u3001\u300c\u5de6\u304b\u3089\u53f3\u300d\u300c\u53f3\u304b\u3089\u5de6\u300d\u306e\u3069\u3061\u3089\u304b\u3067\u3059\u3002<\/p>\n<p>\u88688\u306f\u6f14\u7b97\u5b50\u306e\u512a\u5148\u9806\u4f4d\u304a\u3088\u3073\u7d50\u5408\u898f\u5247\u306e\u4e00\u89a7\u3067\u3059\u3002<\/p>\n<table style=\"border-collapse: collapse; width: 100%; height: 346px;\">\n<tbody>\n<tr style=\"height: 24px;\">\n<td style=\"width: 17.1451%; height: 24px;\">\u512a\u5148\u9806\u4f4d<\/td>\n<td style=\"width: 25.5521%; height: 24px;\">\u6f14\u7b97\u5b50<\/td>\n<td style=\"width: 43.7239%; height: 24px;\">\u8aac\u660e<\/td>\n<td style=\"width: 13.5789%; height: 24px;\">\u7d50\u5408\u898f\u5247<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 17.1451%; height: 322px;\" rowspan=\"13\"><a href=\"https:\/\/www.bold.ne.jp\/engineer-club\/c-language-operators\/image_2024_12_17\" rel=\"attachment wp-att-5456\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.bold.ne.jp\/engineer-club\/wp-content\/uploads\/2024\/12\/image_2024_12_17.png\" alt=\"\u4e0a\u304c\u9ad8\u304f\u3066\u4e0b\u304c\u4f4e\u3044\" width=\"105\" height=\"694\" class=\"size-full wp-image-5456 aligncenter\" \/><\/a><\/td>\n<td style=\"width: 25.5521%; height: 24px;\">++,&#8211;(\u5f8c\u7f6e<span>)<\/span><\/td>\n<td style=\"width: 43.7239%; height: 24px;\">\u5f8c\u7f6e\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30c8<span>\/<\/span>\u30c7\u30af\u30ea\u30e1\u30f3\u30c8<\/td>\n<td style=\"width: 13.5789%; height: 24px;\">\u5de6\u304b\u3089\u53f3<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25.5521%; height: 24px;\">~,!,++,&#8211;(\u524d\u7f6e<span>),<br \/>\nsizeof,(\u30c7\u30fc\u30bf\u578b)<\/span><\/td>\n<td style=\"width: 43.7239%; height: 24px;\">\u30d3\u30c3\u30c8\u53cd\u8ee2\u3001\u8ad6\u7406\u5426\u5b9a\u3001\u524d\u7f6e\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30c8<span>\/<\/span>\u30c7\u30af\u30ea\u30e1\u30f3\u30c8\u3001<span>sizeof<\/span>\u3001\u30ad\u30e3\u30b9\u30c8<\/td>\n<td style=\"width: 13.5789%; height: 24px;\">\u53f3\u304b\u3089\u5de6<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25.5521%; height: 24px;\">*,\/,%<\/td>\n<td style=\"width: 43.7239%; height: 24px;\">\u4e57\u7b97\u3001\u9664\u7b97\u3001\u5270\u4f59\u7b97<\/td>\n<td style=\"width: 13.5789%; height: 226px;\" rowspan=\"10\">\u5de6\u304b\u3089\u53f3<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25.5521%; height: 24px;\">+,-<\/td>\n<td style=\"width: 43.7239%; height: 24px;\">\u52a0\u7b97\u3001\u6e1b\u7b97<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25.5521%; height: 24px;\">&lt;&lt;,&gt;&gt;<\/td>\n<td style=\"width: 43.7239%; height: 24px;\">\u30b7\u30d5\u30c8<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25.5521%; height: 24px;\">&gt;,&gt;=,&lt;,&lt;=<\/td>\n<td style=\"width: 43.7239%; height: 24px;\">\u3088\u308a\u5927\u304d\u3044\u3001\u4ee5\u4e0a\u3001\u3088\u308a\u5c0f\u3055\u3044\u3001\u4ee5\u4e0b<\/td>\n<\/tr>\n<tr style=\"height: 10px;\">\n<td style=\"width: 25.5521%; height: 10px;\">==,!=<\/td>\n<td style=\"width: 43.7239%; height: 10px;\">\u7b49\u3057\u3044\u3001\u7b49\u3057\u304f\u306a\u3044<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25.5521%; height: 24px;\">&amp;<\/td>\n<td style=\"width: 43.7239%; height: 24px;\">\u30d3\u30c3\u30c8\u8ad6\u7406\u7a4d<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25.5521%; height: 24px;\">^<\/td>\n<td style=\"width: 43.7239%; height: 24px;\">\u30d3\u30c3\u30c8\u6392\u4ed6\u7684\u8ad6\u7406\u548c<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25.5521%; height: 24px;\">|<\/td>\n<td style=\"width: 43.7239%; height: 24px;\">\u30d3\u30c3\u30c8\u8ad6\u7406\u548c<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25.5521%; height: 24px;\">&amp;&amp;<\/td>\n<td style=\"width: 43.7239%; height: 24px;\">\u8ad6\u7406\u7a4d<\/td>\n<\/tr>\n<tr style=\"height: 24px;\">\n<td style=\"width: 25.5521%; height: 24px;\">||<\/td>\n<td style=\"width: 43.7239%; height: 24px;\">\u8ad6\u7406\u548c<\/td>\n<\/tr>\n<tr style=\"height: 48px;\">\n<td style=\"width: 25.5521%; height: 48px;\">=,+=,-=,*=,\/=,%=,<br \/>\n&lt;&lt;=,&gt;&gt;=,&amp;=,^=,|=<\/td>\n<td style=\"width: 43.7239%; height: 48px;\">\u4ee3\u5165<\/td>\n<td style=\"width: 13.5789%; height: 48px;\">\u53f3\u304b\u3089\u5de6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"text-align: center;\">\u88688<span>. <\/span>\u6f14\u7b97\u5b50\u306e\u512a\u5148\u9806\u4f4d\u3068\u7d50\u5408\u898f\u5247<\/p>\n<p>\u512a\u5148\u9806\u4f4d\u3068\u306f\u7570\u306a\u308b\u9806\u756a\u3067\u51e6\u7406\u3092\u884c\u3046\u5834\u5408\u306f\u3001\u300c<span>()<\/span>\u300d\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\uff11\uff0d\uff15\uff0e\u3067\u8ad6\u7406\u6f14\u7b97\u5b50\u300c<span>!<\/span>\u300d\u3092\u4f7f\u7528\u3057\u3066\u6f14\u7b97\u3092\u884c\u3046\u4f8b\u3067\u300c<span>()<\/span>\u300d\u3092\u4f7f\u7528\u3057\u307e\u3057\u305f\u304c\u3001\u300c<span>()<\/span>\u300d\u3067\u56f2\u3080\u3053\u3068\u3067\u300c<span>!<\/span>\u300d\u3088\u308a\u3082\u512a\u5148\u5ea6\u306e\u4f4e\u3044\u300c<span>&lt;<\/span>\u300d\u306e\u6f14\u7b97\u3092\u5148\u306b\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2><span id=\"i-11\">\uff13\uff0e\u3055\u3044\u3054\u306b<\/span><\/h2>\n<p>\u6f14\u7b97\u5b50\u306e\u4e00\u89a7\u3068\u5404\u6f14\u7b97\u5b50\u306e\u4f7f\u3044\u65b9\u3001\u512a\u5148\u9806\u4f4d\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002\u6f14\u7b97\u5b50\u306f\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u306f\u5fc5\u305a\u3068\u8a00\u3063\u3066\u3044\u3044\u307b\u3069\u4f7f\u3046\u3082\u306e\u3067\u3059\u304c\u3001\u5404\u6f14\u7b97\u5b50\u306e\u6f14\u7b97\u5185\u5bb9\u3060\u3051\u3067\u306a\u304f\u512a\u5148\u9806\u4f4d\u3092\u628a\u63e1\u3057\u3066\u4f7f\u3044\u3001\u610f\u56f3\u3057\u306a\u3044\u6f14\u7b97\u7d50\u679c\u304c\u51fa\u306a\u3044\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u300c<span>()<\/span>\u300d\u3092\u4f7f\u3046\u3068\u51e6\u7406\u5185\u5bb9\u304c\u308f\u304b\u308a\u3084\u3059\u3044\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uff23\u8a00\u8a9e\u306e\u6f14\u7b97\u5b50\u3068\u306f\u3001\u5909\u6570\u3084\u5b9a\u6570\u306e\u64cd\u4f5c\u3001\u8a08\u7b97\u3092\u884c\u3046\u305f\u3081\u306e\u8a18\u53f7\u3067\u3059\u3002\u6f14\u7b97\u5b50\u306b\u306f\u512a\u5148\u9806\u4f4d\u304c\u3042\u308a\u3001\u5909\u6570\u306e\u5de6\u53f3\u3069\u3061\u3089\u306b\u8a18\u8ff0\u3059\u308b\u304b\u306b\u3088\u3063\u3066\u610f\u5473\u304c\u5909\u308f\u308b\u306a\u3069\u3001\u3088\u304f\u4f7f\u3046\u3082\u306e\u3067\u306f\u3042\u308a\u307e\u3059\u304c\u3001\u4f7f\u3044\u65b9\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u4e3b\u306a\u6f14\u7b97\u5b50 [&hellip;]<\/p>\n","protected":false},"author":32,"featured_media":5463,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"acf":[],"_links":{"self":[{"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/posts\/5451"}],"collection":[{"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/comments?post=5451"}],"version-history":[{"count":13,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/posts\/5451\/revisions"}],"predecessor-version":[{"id":6277,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/posts\/5451\/revisions\/6277"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/media\/5463"}],"wp:attachment":[{"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/media?parent=5451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/categories?post=5451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}