具有整数和双精度的数组和循环 [英] arrays and loops with integers and doubles
本文介绍了具有整数和双精度的数组和循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用整数和双精度编写数组并将它们放入for循环?
How do you write arrays with integers and doubles and put them in for loops?
推荐答案
尝试:
Try:
int data[10];
int index;
for (index = 0; index < 10; index++)
{
data[index] = index * 2;
}
或
Or
double data[10];
int index;
for (index = 0; index < 10; index++)
{
data[index] = index * 2.5;
}
这篇关于具有整数和双精度的数组和循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文