#include<stdio.h>
    #include<string.h>
    typedef struct
    { char name[20];
    long int ptn;
    float lt;
    }census;
    int main()
    { int i,n;
    census city[10];
    printf("How many cities\n");
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
    census city[10];
    printf("Name:");
    gets(city[i].name);
    printf("\nPopulation:");
    scanf("%ld",&city[i].ptn);
    printf("\nlteracy:");
    scanf("%f",&city[i].lt);
    }
    }

Is this a full code?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.