How would you set a variable to the largest number possible in C?

前端 未结 10 640
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-01 17:53

How would you set a variable to equal infinity (or any guaranteed largest number value) in C?

10条回答
  •  误落风尘
    2020-12-01 18:34

    1. Firstly, include a header file named as math.h
    2. Now, equate INT_MAX to the integer whose value you want to set maximum. EXAMPLE:#include //the header file which need to be included// int a=INT_MAX; //Suppose "a" be that integer whose value you want largest//

提交回复
热议问题