Answers for "parallel arrays in c"

C
0

parallel arrays in c

// Parallel Arrays
 // parallel.c

 #include <stdio.h>

 int main(void)
 {
         int i;
         int sku[]      = { 2156, 4633, 3122, 5611};
         double price[] = { 2.34, 7.89, 6.56, 9.32};
         const int n    = 4;

         printf("  SKU Price\n");
         for (i = 0; i < n; i++)
                 printf("%5d $%.2lf\n", sku[i], price[i]); 

         return 0;
 }
Posted by: Guest on October-27-2021

Code answers related to "C"

Browse Popular Code Answers by Language