اكتب برنامج C لقراءة وطباعة عناصر مصفوفة طولها 7 ، قبل الطباعة ، ضاعف الموضع السابق ثلاث مرات بدءًا من الموضع الثاني للمصفوفة
- برمجة
- برمجة سي c
- 2021-05-02
- Wassim
الأجوبة
/*Write a C program to read and print the elements of an array of length 7, before print, put the triple of the previous position starting from the second position of the array*/
#include <stdio.h>
int main() {
int n[5], i, x;
printf("Input the first number of the array:\n");
scanf("%d", &x);
for(i = 0; i < 5; i++)
{
n[i] = x;
x = 3*x;
}
for(i = 0; i < 5; i++)
{
printf("n[%d] = %d\n", i, n[i]);
}
return 0;
}أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال