当前位置:网站首页>C language classic examples - find the largest number in a series of numbers
C language classic examples - find the largest number in a series of numbers
2022-08-05 11:54:00 【Blue_lan18】
Write a program to find the largest number in a string of numbers entered by the user.The program needs to prompt the user to enter the numbers one by one.When the user enters 0 or a negative number, the program must display the largest non-negative number that has been entered.
# include int main(){double number;double largest = 0;do{printf("Enter a number: ");scanf("%lf", &number);if(largest < number){largest = number;}else{continue;//If largest is not less than number, return to input state}}while(number > 0);printf("The largest number entered was %.2f\n", largest);return 0;} 
边栏推荐
- Flink Yarn Per Job - RM启动SlotManager
- Apache APISIX Ingress v1.5-rc1 released
- Reflect中的方法
- A woman is the most beautiful life in the world
- Introduction to the Evolution of Data Governance System
- 安装tldr
- 2022 极术通讯-基于安谋科技 “星辰” STAR-MC1的灵动MM32F2570开发板深度评测
- 2022.08.01_每日一题
- 多业务模式下的交易链路探索与实践
- 互联网行业凛冬之至,BATM的程序员是如何应对中年危机的?
猜你喜欢

官方发布·2022南京智博会定于10月份在新庄国展召开

手把手教你定位线上MySQL慢查询问题,包教包会

【无标题】

KVM虚拟化技术的-NUMA技术和应用

【HMS core】【FAQ】Health Kit, Ads kit, Push Kit Typical Questions Collection 5

Version Control | Longzhi invites you to go to the GOPS Global Operation and Maintenance Conference to explore the road of large-scale, agile, high-quality and open software development and operation

Official release 2022 Nanjing Zhibo Expo is scheduled to be held in Xinzhuang National Exhibition in October

365 days challenge LeetCode1000 questions - Day 050 add a row to the binary tree binary tree

祝所有码农七夕快乐~

Cesium.js 三维土壤地质剖面分割挖掘
随机推荐
2022 极术通讯-基于安谋科技 “星辰” STAR-MC1的灵动MM32F2570开发板深度评测
2022 CCF国际AIOps挑战赛决赛暨AIOps研讨会报名已开启
ORACLE ASM提供的三种冗余方式
Cesium.js 地形挖洞
Letter from Silicon Valley: Act fast, Facebook, Quora and other successful "artifacts"!
高泽龙出席博鳌全球旅游生态大会 讲元宇宙与未来网络科技
Zhihu asks: Can China still achieve great national rejuvenation?
Go 语言快速入门指南: 基本类型
“小钢炮”气质明显,安全、舒适一个不落
KVM虚拟化技术的-NUMA技术和应用
什么是缓冲区(buffer),什么是缓存(cache)
家用电器行业数智化供应链系统:高效整合供应链,提升家电企业核心竞争力
没开发人员,接到开发物联网系统的活儿,干不干?
C语言例题-计算常量e的值
STM32H743IIT6学习笔记02——USART
解决 cuDNN launch failure 错误
STM32H743IIT6学习笔记03——使用第三方组件FreeRTOS
Four, kubeadm single master
消息中间件汇总
低代码平台开发有什么好处?