هذا السؤال ومطلوب مني الجواب بكره .. يعني ابي الحل اليوم ..
يا جماعة يعلم الله اني متوهق لسبب واحد ان البرنامج مطلوب حله بالسترينج والمهندس الله يهداه ما عطانا إلا نبذه مصغره عن السترنج وما فهمنا شيء ..
واليوم عطانا هذا السؤال وقال انه يعتبر الفاينل وانا ماني عارف شلون احله .. قلت مالي إلا اخواني المبرمجين ..
اللي يحله اسأل الله انه يعينه على هذه الدنيا وان يدخله جنات النعيم الفردوس الأعلى ..
لكن لي طلب ابي الحل على الرسائل الخاصة لاسباب خاصة .
البرنامج مطلوب عمل 4 فنكشن ..+ المين ..
Write a program that defines an array of integers of size 20 and calls a function according to the input passed
to it by the user.
The program should take at least 10 consecutive commands without exiting the rogram -loops at least 10 time.
If the user input the word "INIT" the program calls a function called initialize that initializes the array to a
number input by the user. The user needs to specify the initial vaue needed to initialize the array from stdin.
E.g. INIT 7 initializes all elements of the array to the number 7.
If the user input the word "ADD" the program calls a function called add that adds a number to the element of the array. the
number is specified by the user from stdin.
E.g. ADD 12 5 adds the value 12 to the fifth element of the array.
If the user input the word "DEL" the program calls a function that resets the element of the array specified by the user to -1.
E.g. DEL 4 resets the value of the 4th element of the array to -1.
If the user input the word "PRINT" the program calls a function that prints the first n elements of the array.
If the user inputs a number larger than the size of the array, the function will print the whole array.
The function should not print the elements of the array that have -1 as their value.
E.g. PRINT 4: prints the first 4 elements of the array skipping elements that have been deleted.
If the user inputs PRINT 1000, the program should print all the elements in the array skipping elements that have been deleted.
Note: Appropriate error messages should be displayed when an error occurs.
Hint: you need to use the string library <string.h> to compare two strings together.