#include<stdio.h>
#include<conio.h>
int main(){
int marks[3];
printf("enter number for first array");
scanf("%d",marks[0]);
printf("enter number for second array");
scanf("%d",marks[1]);
printf("enter number for third array");
scanf("%d",marks[2]);
printf("the value of first array is %d",marks[0]);
printf("the value of first array is %d",marks[1]);
printf("the value of first array is %d",marks[2]);
return 0;
}
i was expecting that it will print value of matrix but it keeps saying this progarm has unexpectly closed down
>Solution :
scanf() expects you to pass the address of the variable to fill, eg:
scanf("%d",&marks[0]);
& is the address-of operator which provides that.