Answers for "printing an array name in c"

C
2

array value from user c

#include <stdio.h>
int main(void)
{
int size, i;
printf("Enter the size of the arrays:n");
scanf("%d", &size);

int arr1[size];
printf("Enter the elements of the array:n");
for (i = 0; i < size; i++) {
    scanf_s("%d", arr1[size]);
}
printf("The current array is:n %d", arr1[i]);
}
Posted by: Guest on September-21-2020
0

create array of strings in c from user input

#include <stdio.h>

int main()
{
   char str[5][10];

   printf("enter the strings...n");
   for(int i =0; i < 5; i++)
   scanf("%s", str[i]);

   printf("All strings are...n");
   for(int j =0; j < 5; j++)
   printf("%sn", str[j]);
}
Posted by: Guest on April-29-2021

Code answers related to "C"

Browse Popular Code Answers by Language