bsc

Comprehensive codebase and cou...
Log | Files | Refs | README | LICENSE

luc059.c (1043B)


      1 /*
      2  * Author  : Amit Dutta <amitdutta4255@gmail.com>
      3  * Date    : 08 Feb 2026
      4  * Repo    : https://github.com/notamitgamer/bsc
      5  * License : MIT License (See the LICENSE file for details)
      6  */
      7 
      8 /* Write a program which initializes an integer array of 10 elements in main(), passes it to modify(), multiplies each element by 3, and prints the new array in main().
      9 */
     10 
     11 /* Let Us C, Chap- 13 (Arrays), Qn No.: B(e) */
     12 
     13 /* This file is auto-generated by a bot. */
     14 /* This code is not compiled; it is for reference only. */
     15 
     16 
     17 #include <stdio.h>
     18 #include <math.h>
     19 #include <stdlib.h>
     20 
     21 void modify(int *, int);
     22 
     23 int main()
     24 {
     25     int arr[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
     26     int i;
     27 
     28     printf("Original Array:\n");
     29     for (i = 0; i < 10; i++)
     30         printf("%d ", arr[i]);
     31     
     32     modify(arr, 10);
     33 
     34     printf("\n\nModified Array (x3):\n");
     35     for (i = 0; i < 10; i++)
     36         printf("%d ", arr[i]);
     37     printf("\n");
     38 
     39     return 0;
     40 }
     41 
     42 void modify(int *a, int n)
     43 {
     44     int i;
     45     for (i = 0; i < n; i++)
     46     {
     47         a[i] = a[i] * 3;
     48     }
     49 }
© notamitgamer • Site Built: 2026-07-21 13:58:23 UTC • git-mirror commit: 1037f62 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror