Write a c program to accept different goods with the number price and date of purchase and display those using structure

#include<stdio.h>
struct goods {
    int no;
    float price;
    char date[20];
};
void main(){
    int n,i;
    struct goods g[20];
    printf("Enter number of goods: ");
    scanf("%d",&n);
    for(i=0;i<n;i++)
        scanf("%d%f%s",&g[i].no,&g[i].price,g[i].date);
    for(i=0;i<n;i++)
        printf("%d %.2f %s\n",g[i].no,g[i].price,g[i].date);
}