本文介绍了将WHILE LOOP转换为FUNCTIONS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 大家好!:)我再次需要你的帮助..我得到了一个while循环程序的代码,我们的教授让我们把它转换成函数。请有人帮帮我。它必须转换为3种类型。 1.无效 2.无效但带参数 3. w / out void但返回值 这里是代码: 1 #include< stdio.h> 2 #include< ; iostream.h> 3 #include< conio.h> 4 5 int main(无效) 6 7 { 8 9 int i,j; 10 i = 0; 11 while(i< = 4){ 12 j = 0; 13 while(j< = 4){ 14 j ++; 15} 16 i ++; 17} 18 i ++; 19 printf("%d",i * j); 20 21返回0; 22} 我已经运行此程序,输出为30.我非常感谢大家的帮助。非常感谢Hello everyone!:) i need your help again..i got there a code of a while loop program and our prof let us convert it into functions. can anyone help me please. It must be converted into 3 types.1. void only2. void but with parameter3. w/out void but with return valueHere''s the code:1#include <stdio.h>2#include <iostream.h>3#include <conio.h>45int main(void)67{89int i, j;10i=0;11 while (i<=4) {12 j=0;13 while (j<=4) {14 j++;15 }16 i++;17}18i++;19printf("%d", i*j);2021return 0;22}I run this program already and the output is 30. I really appreciate your help everyone. Thank you very much推荐答案 其中一个例子就是创建一个返回i和j的产品的函数An example of one of these would be to create a function that returns the product of i and j 展开 | 选择 | Wrap | 行号 只有void的函数不带参数,什么都不返回A void only function takes no parameters and returns nothing 展开 | 选择 | Wrap | 行号 这篇关于将WHILE LOOP转换为FUNCTIONS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-05 10:18
查看更多