C/C++语言 - C/C++数据

Similar documents
C C

C/C++程序设计 - 字符串与格式化输入/输出

CC213

C

Microsoft Word - CPE考生使用手冊 docx

C 1

C/C++ - 文件IO

C/C++语言 - 运算符、表达式和语句

2013 C 1 # include <stdio.h> 2 int main ( void ) 3 { 4 int cases, a, b, i; 5 scanf ("%d", & cases ); 6 for (i = 0;i < cases ;i ++) 7 { 8 scanf ("%d %d

C/C++ - 函数

C 1 # include <stdio.h> 2 int main ( void ) { 4 int cases, i; 5 long long a, b; 6 scanf ("%d", & cases ); 7 for (i = 0;i < cases ;i ++) 8 { 9

新版 明解C言語入門編

C/C++ - 字符输入输出和字符确认

新・解きながら学ぶC言語

新・明解C言語入門編『索引』

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.06.doc

新版 明解C++入門編

C/C++ 语言 - 循环

1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File

untitled

C/C++语言 - 分支结构

c_cpp

2013 C 1 #include <stdio.h> 2 int main(void) 3 { 4 int cases, i; 5 long long a, b; 6 scanf("%d", &cases); 7 for (i = 0; i < cases; i++) 8 { 9 scanf("%

( CIP) /. :, ( ) ISBN TP CIP ( 2005) : : : : * : : 174 ( A ) : : ( 023) : ( 023)

untitled

02

FY.DOC

CC213

C/C++ - 数组与指针

第3章.doc

3.1 num = 3 ch = 'C' 2

51 C 51 isp 10 C PCB C C C C KEIL

IO

C

CC213

nooog

C/C++ - 字符串与字符串函数

CHAPTER VC#

6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C C C51 C51 ANSI C MCS-51 C51 ANSI C C C51 bit Byte bit sbit

Ps22Pdf

untitled

Microsoft PowerPoint - STU_EC_Ch02.ppt

C++ 程式設計

untitled

C/C++ - 结构体、共用体、枚举体

Microsoft Word - 第3章.doc

C语言的应用.PDF

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.07.doc

华恒家庭网关方案

C PICC C++ C++ C C #include<pic.h> C static volatile unsigned char 0x01; static volatile unsigned char 0x02; static volatile unsigned cha

1 LINUX IDE Emacs gcc gdb Emacs + gcc + gdb IDE Emacs IDE C Emacs Emacs IDE ICE Integrated Computing Environment Emacs Unix Linux Emacs Emacs Emacs Un

untitled

Eclipse C C++, or

教 师 资 格 考 试 之 面 试 备 考 指 导 中 公 教 育 教 师 考 试 研 究 院

CHAPTER 1

WWW PHP Comments Literals Identifiers Keywords Variables Constants Data Types Operators & Expressions 2

C++ 程序设计 告别 OJ1 - 参考答案 MASTER 2019 年 5 月 3 日 1

2015年计算机二级(C语言)模拟试题及答案(四)

untitled

数据结构与算法 - Python基础

int *p int a 0x00C7 0x00C7 0x00C int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++;

新・解きながら学ぶJava

《C语言程序设计》教材习题参考答案

_汪_文前新ok[3.1].doc

untitled

1990 8

C++ 程序设计 告别 OJ2 - 参考答案 MASTER 2019 年 5 月 3 日 1

プログラムの設計と実現II

第8組 王玉妏、黃怡君、殷秀菁

C

FZUBRIDGE

, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1

Microsoft Word - C-pgm-ws2010.doc

立 志 于 打 造 最 贴 近 考 生 实 际 的 辅 导 书 计 算 机 考 研 之 数 据 结 构 高 分 笔 记 率 辉 编 著 周 伟 张 浩 审 核 讨 论 群 :

Microsoft PowerPoint - string_kruse [兼容模式]

Microsoft Word - 烘焙食品乙級第二部份 doc

ebook39-5

第7章-并行计算.ppt

extend

download.kaoyan.com_2006ÄêÌì½ò¹¤Òµ´óѧ¸ß¼¶ÓïÑÔ³ÌÐòÉè¼Æ£¨409£©¿¼ÑÐÊÔÌâ

1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET NET Framework.NET Framework 2.0 ( 3 ).NET Framework 2.0.NET F

Microsoft Word - 01.DOC

untitled

,,,,,,,,,, ( http: \ \ www. ncre. cn,, ) 30,,,,,,,, C : C : : 19 : : : /16 : : 96 : : : ISBN 7

<5B BECBB0EDB8AEC1F25D312D34B0AD5FC3E2BCAEBCF6BEF7C0DAB7E F31702E504446>

第七讲 继承与多态

untitled

untitled

扉页

PIC_SERVER (11) SMTP ( ) ( ) PIC_SERVER (10) SMTP PIC_SERVER (event driven) PIC_SERVER SMTP 1. E-

untitled

<4D F736F F D20B2C43032B3B920B8EAAEC6ABACBA41BB50AAEDA5DCA6A12E646F63>

科学计算的语言-FORTRAN95

z x / +/- < >< >< >< >< > 3 b10x b10x 0~9,a~f,A~F, 0~9,a~f,A~F, x,x,z,z,?,_ x,x,z,z,?,_ h H 0~9,_ 0~9,_ d D 0~7,x,X,z,Z

Microsoft PowerPoint - ds-1.ppt [兼容模式]

untitled

保母人員丙級應檢資料第二部份 doc

chap07.key

Microsoft PowerPoint - ICP_02_Basic_Data_Type.ppt [相容模式]

Microsoft Word - ch04三校.doc

Transcription:

C/C++ C/C++

Table of contents 1. 2. 3. 4. char 5. 1

C = 5 (F 32). 9 F C 2

1 // fal2cel. c: Convert Fah temperature to Cel temperature 2 # include < stdio.h> 3 int main ( void ) 4 { 5 float fah, cel ; 6 printf (" Please input the Fah temperature :\ n"); 7 scanf ("%f", & fah ); 8 cel = ( fah - 32.) * 5./9.; 9 printf (" %.2 f F = %.2 f C\n", fah, cel ); 10 return 0; 11 } 3

$ gcc fah2cel. c $./a. out Please input the Fahrenheit temperature : 78 78. 00 F = 25. 56 C 4

float fah, cel ; float %f %.2f scanf() %f scanf() &fah fah fah 5

scanf() printf() scanf() printf() 6

: 1. 2. 7

12 0-3 3.1415-1.23 a b 8

: 9

: : C/C++ 9

# define #define 10

# include < stdio.h> # define PRICE 100 int main ( void ) { int num, total ; num = 10; total = num * PRICE ; printf (" total =%d\n", total ); return 0; } 11

# include < stdio.h> # define PRICE 100 int main ( void ) { int num, total ; num = 10; total = num * PRICE ; printf (" total =%d\n", total ); return 0; } 11

: 12

C C++ a 3 13

42 42.0 14

int signed _Bool long void _Complex short _Imaginary unsigned char float double 15

int long short unsigned signed char float double long double true false C _Bool C++: bool C complex C++ complex 16

# include < stdio.h> int main ( void ) { _Bool is_ printed = 1; if ( is_printed ) printf (" Hello world!\n"); return 0; } 17

# include < stdio.h> int main ( void ) { _Bool is_ printed = 1; if ( is_printed ) printf (" Hello world!\n"); return 0; } # include < iostream > using namespace std ; int main () { bool is_ printed = true ; if ( is_printed ) cout << " Hello world!" << endl ; return 0; } 17

1: C complex.h creal cimag conj cabs carg 18

# include <stdio.h> # include < complex.h> int main ( void ) { double complex a = 1 + 1I; printf ("a = (%.2f, %.2 f)\n", creal (a), cimag (a)); double complex b = conj ( a); printf ("b = (%.2f, %.2 f)\n", creal (b), cimag (b)); printf (" arg = %.5 f\n", carg (a)); printf (" abs = %.5 f\n", cabs (a)); return 0; } 19

2: C++ complex real imag conj abs arg 20

# include < cstdio > # include < complex > using namespace std ; int main ( void ) { complex < double > a (1.0, 1.0) ; printf ("a = (%.2f, %.2 f)\n", a. real (), a. imag ()); complex < double > b = conj (a); printf ("b = (%.2f, %.2 f)\n", b. real (), b. imag ()); printf (" arg = %.5 f\n", arg (a)); printf (" abs = %.5 f\n", abs (a)); return 0; } 21

1. 2. 1 22

0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1: 10 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 10 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1-10 2: -10 23

int int C limits.h C++ limits std::numeric_limits C 24

int // int_info.c # include < stdio.h> # include < limits.h> int main ( void ) { printf (" range of int is % d ~ % d\ n", INT_MIN, INT_MAX ); printf (" sizeof int = %lu bytes \n", sizeof ( int )); return 0; } 25

int // int_info.c # include < stdio.h> # include < limits.h> int main ( void ) { printf (" range of int is % d ~ % d\ n", INT_MIN, INT_MAX ); printf (" sizeof int = %lu bytes \n", sizeof ( int )); return 0; } $ gcc int_info.c $./a. out range of int is - 2147483648 ~ 2147483647 sizeof int = 4 bytes 25

int // int_info. cpp # include < cstdio > # include < limits > using namespace std ; int main () { printf ( " range of int is %d ~ %d\n", numeric_limits <int >:: min (), numeric_limits <int >:: max () ); printf ( " sizeof int = %lu bytes \n", sizeof ( int ) ); return 0; } 26

int // int_info. cpp # include < cstdio > # include < limits > using namespace std ; int main () { printf ( " range of int is %d ~ %d\n", numeric_limits <int >:: min (), numeric_limits <int >:: max () ); printf ( " sizeof int = %lu bytes \n", sizeof ( int ) ); return 0; } $ g++ int_info. cpp $./a. out range of int is - 2147483648 ~ 2147483647 sizeof int = 4 bytes 26

int int int var ; int var1, var2 ; int 27

int int 1. int n; n = 1; 2. scanf int n; scanf ("%d", &n); 3. int n = 1; 28

int int a = 1; int b = 2, c = 3; int d, e = 4; // valid, but not good 29

int 30

int int a; a int b=2; 2 b 3: 30

int // print1. c: display some properties of printf () # include < stdio.h> int main ( void ) { int a = 10; int b = 2; printf (" Doing it right : "); printf ("%d - %d = %d\n", a, b, a-b); printf (" Doing it wrong : "); printf ("%d - %d = %d\n", a); return 0; } 31

int // print1. c: display some properties of printf () # include < stdio.h> int main ( void ) { int a = 10; int b = 2; printf (" Doing it right : "); printf ("%d - %d = %d\n", a, b, a-b); printf (" Doing it wrong : "); printf ("%d - %d = %d\n", a); return 0; } $ gcc print1. c $./a. out Doing it right : 10-2 = 8 Doing it wrong : 10-73832 = 771 31

int print() a %d %d printf() 32

C 0x 0X 16 0x10 0X10 0 16 020 33

1 // bases. c: print 100 in decimal, octal and hex 2 # include <stdio.h> 3 int main ( void ) 4 { 5 int x = 100; 6 printf (" dec = %d; oct = %o; hex = %X\n", x, x, x); 7 printf (" dec = %d; oct = %#o; hex = %#X\n", x, x, x); 8 return 0; 9 } 34

1 // bases. c: print 100 in decimal, octal and hex 2 # include <stdio.h> 3 int main ( void ) 4 { 5 int x = 100; 6 printf (" dec = %d; oct = %o; hex = %X\n", x, x, x); 7 printf (" dec = %d; oct = %#o; hex = %#X\n", x, x, x); 8 return 0; 9 } $ gcc bases. c $./a. out dec = 100; oct = 144; hex = 64 dec = 100; oct = 0144; hex = 0 x64 34

%d %o %#o %x %X %#x %#X 35

C/C++ 4 int short long unsigned signed short (int) %hd, %ho, %hx long (int) %ld, %lo, %lx long long (int) %lld, %llo, % llx unsigned (int) %u unsigned long (int) unsigned long long (int) %lu %llu 36

C/C++ 4 int short long unsigned signed short (int) %hd, %ho, %hx long (int) %ld, %lo, %lx long long (int) %lld, %llo, % llx unsigned (int) %u unsigned long (int) unsigned long long (int) %lu %llu signed short short int signed short signed short int 36

? 37

? CPU long int short 37

? CPU long int short C/C++ short int long int 37

38

# include <stdio.h> # include <limits.h> int main ( void ) { int i = INT_MAX ; unsigned int j = UINT_ MAX ; printf ("i = %d, i+1 = %d, i+2 = %d\n", i, i+1, i +2) ; printf ("j = %u, j+1 = %u, j+2 = %u\n", j, j+1, j +2) ; return 0; } $ gcc intoverflow. c $./a. out i = 2147483647, i +1 = -2147483648, i +2 = -2147483647 j = 4294967295, j +1 = 0, j +2 = 1 39

unsigned int 0 int 2147483648 40

unsigned int 0 int 2147483648 40

char

char : char char a, b, =, +,? char 41

char char char ASCII 5 5 5 char 42

char char a, b; char c; A grade char grade = A ; 43

char char a, b; char c; A grade char grade = A ; A char grade ; // char grade = A ; // grade = A; // grade = "A"; // grade = 65; // 43

ASCII 44

ASCII char a = x ; char b = y ; x y ASCII 120 121 a b a: 0 1 1 1 1 0 0 0 b: 0 1 1 1 1 0 0 1 44

C/C++ 45

printf() %c %d ASCII 46

printf() %c %d ASCII // charcode. c: displays code number for a char # include <stdio.h> int main ( void ) { char c; printf (" Please input a character :\n"); scanf ("%c", &c); printf (" the code for %c is %d\n", c, c); return 0; } 46

printf() %c %d ASCII // charcode. c: displays code number for a char # include <stdio.h> int main ( void ) { char c; printf (" Please input a character :\n"); scanf ("%c", &c); printf (" the code for %c is %d\n", c, c); return 0; } $ gcc charcode. c $./a. out Please input a character : A 46

ch 0 1 0 0 0 0 1 1 %c %d A 65 47

1 000 000 000 1.0 10 9 1.0e9 123 000 1.23 10 5 1.23e5 322.56 3.2256 10 2 3.2256e2 0.000 056 5.6 10 5 5.6e-5 48

C float double long double 49

C float 32 6 10 37 10 +37 double 64 10 float C long double double IEEE float IEEE R32.24 double IEEE R64.53 50

// float.c # include <stdio.h> # include <float.h> int main ( void ) { printf (" ----float ---\n"); printf (" range : %e ~ %e\n", FLT_MIN, FLT_MAX ); printf (" epsilon : %e\n", FLT_EPSILON ); printf (" size : %lu bytes \n\n", sizeof ( float )); printf (" ---- double ---\n"); printf (" range : %e ~ %e\n", DBL_MIN, DBL_MAX ); printf (" epsilon : %e\n", DBL_EPSILON ); printf (" size : %lu bytes \n\n", sizeof ( double )); printf (" ---- long double ---\n"); printf (" range : %Le ~ %Le\n", LDBL_MIN, LDBL_MAX ); printf (" epsilon : %Le\n", LDBL_EPSILON ); printf (" size : %lu bytes \n", sizeof ( long double )); return 0; } 51

----float --- range : 1.175494 e -38 ~ 3.402823 e +38 epsilon : 1.192093 e -07 size : 4 bytes ---- double --- range : 2.225074 e -308 ~ 1.797693 e +308 epsilon : 2.220446 e -16 size : 8 bytes ---- long double --- range : 3.362103 e -4932 ~ 1.189731 e +4932 epsilon : 1.084202 e -19 size : 16 bytes 52

i // float. cpp # include <iostream > # include <limits > using namespace std ; int main ( void ) { cout << " ----float ----" << endl << " range : " << numeric_limits < float >:: min () << " ~ " << numeric_limits < float >:: max () << endl << " prec : " << numeric_limits < float >:: epsilon () << endl << " size : " << sizeof ( float ) << endl << endl ; cout << " ---- double ----" << endl << " range : " << numeric_limits < double >:: min () << " ~ " << numeric_limits < double >:: max () << endl << " prec : " << numeric_limits < double >:: epsilon () << endl 53

ii << " size : " << sizeof ( double ) << endl ; } cout << " ---- long double ----" << endl << " range : " << numeric_limits < long double >:: min () << " ~ " << numeric_limits < long double >:: max () << endl << " prec : " << numeric_limits < long double >:: epsilon () << endl << " size : " << sizeof ( long double ) << endl ; return 0; 54

----float ---- range : 1.17549 e -38 ~ 3.40282 e +38 prec : 1.19209 e -07 size : 4 ---- double ---- range : 2.22507 e -308 ~ 1.79769 e +308 prec : 2.22045 e -16 size : 8 ---- long double ---- range : 3.3621 e -4932 ~ 1.18973 e +4932 prec : 1.0842 e -19 size : 16 55

1. (sign) 0 1 2. (exponent) 3. (mantissa) 56

R32.24 R64.53 (120.5) 10 = (1110110.1) 2 (1.1101101 2 6 ) 2 57

R32.24 R64.53 (120.5) 10 = (1110110.1) 2 (1.1101101 2 6 ) 2 1. 2 n. 1 23 24 57

24 (9) 10 = (1001) 2, 1 24 float 6 58

8 127 128 +127 59

8.25 1. 8.25 1.0001 2 3 60

8.25 1. 8.25 1.0001 2 3 2. 0 3 +127 = 130 = (1000 0010) 2 (0001) 2 60

8.25 1. 8.25 1.0001 2 3 2. 0 3 +127 = 130 = (1000 0010) 2 (0001) 2 3. 0 1000 0010 000 1000 0000 0000 0000 0000 130 = 3 +127 000 1 1.0001 2 3 60

120.5 1. 120.5 1.1101101 2 6 61

120.5 1. 120.5 1.1101101 2 6 2. 0 6 +127 = 133 = (1000 0101) 2 (1101101) 2 61

120.5 1. 120.5 1.1101101 2 6 2. 0 6 +127 = 133 = (1000 0101) 2 (1101101) 2 3. 0 1000 0010 110 1101 0000 0000 0000 0000 133 = 6+127 110 1101 1.1101101 2 6 61

01000010111001011000000000000000, 62

1. 0 1000 0101 110 0101 1000 0000 0000 0000 63

1. 0 1000 0101 110 0101 1000 0000 0000 0000 2. 0 (1000 0101) 2 = 133 133 127 = 6 (1.1100101 2 6 ) 2 = (1110010.1) 2 = 114.5. 63

// float2double. c: # include <stdio.h> int main ( void ) { float f1 = 2.2, f2 = 2.25; double g1, g2; g1 = ( double ) f1; g2 = ( double ) f2; printf ("g1 = %.13f, g2 = %.13 f\n", g1, g2); return 0; } 64

// float2double. c: # include <stdio.h> int main ( void ) { float f1 = 2.2, f2 = 2.25; double g1, g2; g1 = ( double ) f1; g2 = ( double ) f2; printf ("g1 = %.13f, g2 = %.13 f\n", g1, g2); return 0; } g1 = 2. 2000000476837, g2 = 2. 2500000000000 64

2.2 2.25 65

2.2 2.25 2.25 0 1000 0001 001 0000 0000 0000 0000 0 1000 0001 001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 65

2 0. 2 2 0. 4 0 2 0. 8 0 2 1. 6 1 2 1. 2 1 2 0. 4 0 66

2.2 10. 0011 0011 0011 0011 0011... 67

2.2 0 1000 0001 000 1100 1100 1100 1100 0 1000 0001 000 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 68

e E 10-1.56 E+12, 2.87e -3 69

+2.87e -3 2.87e -3 2E5 19.28 2 // is an integer 3. e12.45e -5 70

1.56 E +12 // wrong double some float some = 4.0 * 2. 0; 4.0 2.0 double 64 float 71

f F float 2.3 f 3.4 e9f l L long double l 1 L 54.3 l 4.3 E9L 72

// float1. c: What is the output? # include < stdio.h> int main ( void ) { float x = 0.1; if (x == 0.1) printf ("IF\n"); else if (x == 0.1 f) printf (" ELSE IF\n"); else printf (" ELSE \n"); } 73

// float1. c: What is the output? # include < stdio.h> int main ( void ) { float x = 0.1; if (x == 0.1) printf ("IF\n"); else if (x == 0.1 f) printf (" ELSE IF\n"); else printf (" ELSE \n"); } ELSE IF 73

// float1. c: What is the output? # include < stdio.h> int main ( void ) { float x = 0.1; if (x == 0.1) printf ("IF\n"); else if (x == 0.1 f) printf (" ELSE IF\n"); else printf (" ELSE \n"); } ELSE IF x 0.1 0.1f 0.1 0.1 0.1 0.1!= 0.1f x == 0.1f 73

// float2. c: What is the output? # include < stdio.h> int main ( void ) { float x = 0.1; printf ("%lu %lu %lu\n", sizeof (x), sizeof (0.1), sizeof (0.1 f)); return 0; } 74

// float2. c: What is the output? # include < stdio.h> int main ( void ) { float x = 0.1; printf ("%lu %lu %lu\n", sizeof (x), sizeof (0.1), sizeof (0.1 f)); return 0; } 4 8 4 74

// float2. c: What is the output? # include < stdio.h> int main ( void ) { float x = 0.1; printf ("%lu %lu %lu\n", sizeof (x), sizeof (0.1), sizeof (0.1 f)); return 0; } 4 8 4 74

// float3. c: What is the output? # include < stdio.h> int main ( void ) { float x = 0.5; if (x == 0.5) printf ("IF\n"); else if (x == 0.5 f) printf (" ELSE IF\n"); else printf (" ELSE \n"); } 75

// float3. c: What is the output? # include < stdio.h> int main ( void ) { float x = 0.5; if (x == 0.5) printf ("IF\n"); else if (x == 0.5 f) printf (" ELSE IF\n"); else printf (" ELSE \n"); } IF 75

// float3. c: What is the output? # include < stdio.h> int main ( void ) { float x = 0.5; if (x == 0.5) printf ("IF\n"); else if (x == 0.5 f) printf (" ELSE IF\n"); else printf (" ELSE \n"); } IF x 0.5 0.5f 0.5 0.5f 0.5 0.5 == 0.5f x == 0.5 75

%f float double %e %Lf %Le long double 76

// showf_pt.c: # include <stdio.h> int main ( void ) { float a = 32000.; double b = 2.14 e9; long double c = 5. 32 e -5; printf ("%f can be written as %e\n", a, a); printf ("%f can be written as %e\n", b, b); printf ("%Lf can be written as %Le\n", c, c); return 0; } 77

// showf_pt.c: # include <stdio.h> int main ( void ) { float a = 32000.; double b = 2.14 e9; long double c = 5. 32 e -5; printf ("%f can be written as %e\n", a, a); printf ("%f can be written as %e\n", b, b); printf ("%Lf can be written as %Le\n", c, c); return 0; } 32000. 000000 can be written as 3. 200000 e +04 2140000000. 000000 can be written as 2. 140000 e +09 0. 000053 can be written as 5. 320000 e -05 77

# include <stdio.h> int main ( void ) { float toobig = 1 e39 ; printf (" toobig = %f\n",toobig ); return 0; } 78

# include <stdio.h> int main ( void ) { float toobig = 1 e39 ; printf (" toobig = %f\n",toobig ); return 0; } toobig = inf 78

# include <stdio.h> int main ( void ) { float toobig = 1 e39 ; printf (" toobig = %f\n",toobig ); return 0; } toobig = inf overflow C inf 78

# include <stdio.h> int main ( void ) { float a,b; a = 2. e20 + 1; b = a - 2. e20 ; printf ("b = %f\n", b); return 0; } 79

# include <stdio.h> int main ( void ) { float a,b; a = 2. e20 + 1; b = a - 2. e20 ; printf ("b = %f\n", b); return 0; } b = 4008175468544. 000000 79

# include <stdio.h> int main ( void ) { float a,b; a = 2. e20 + 1; b = a - 2. e20 ; printf ("b = %f\n", b); return 0; } b = 4008175468544. 000000 2.0e20 1 21 21 float 6 7 79