السلام عليكــم ورحمـة الله وبركاتــه ،،
لو سمحتم احد يصحح لي هذا الكوود
ويكمل لي الكود الناقص
لاني توقفت عند نقطة لا اعرفها
وشاكره لكم تعاونكم :D
1.Write a function void createArithmeticSeq(int [], int); that prompts the user to input two numbers, first and diff. the function hen creates a one-dimensional array of n elements ordered in an arithmetic sequence. For example, if n = 16, first = 21 and diff = 5, the arithmetic sequence is:
21 26 31 36 41 46 51 56 61 66 71 76 81 86 91 96
2.Write a function that takes an array and its size as parameters, the function should print the content of the array, the prototype of the function is void print(int [], int);
3.Write a program that defines an intger array , then calls the previously mentioned two functions.
# include <iostream>
using namespace std;
void createArithmeticSeq(int array[],int size);
{
int array[];
cout <<"enter two num "<<endl;
int first,diff;
cin>>first;
cin>>diff;
array[0]=first;
int index ;
for ( index=1;index<size;index++)
array[index]=array[index-1] + diff;
}