In: Computer Science
Write code that would allocate the space for an array of 20 integers. It will be pointed to by a variable named "junk"
Write code that puts “file did not open” into an error stream.
Q1.
#include<stdio.h>
#include<conio.h>
int main()
{
int a[20], i;
int *junk;
printf("\n Enter the elements:");
for(i=0;i<20;i++)
{
scanf("%d", &a[i]);
}
junk=&a[0];
printf("\n Elements are:");
for(i=0;i<20;i++)
{
printf("%d",a[i]);
printf("\n");
}
getch();
return 0;
}
Please upvote ??.