C program to construct a structure , C/C++ Programming

c program to construct a structure:

struct sensus


                                char name[30];

                                long int population;

                                float litracy_rate;



                void main()


                                struct sensus city[5];

                                printf("\n Enter Data for 5 cities:\n");

                                                for(int i=0; i<5;i++)


                                                                printf("\n City Name:\t");


                                                                printf("\n Population:\t");


                                                                printf("\n litracy rate:\t");




                                                for(i=0; i<4;i++)

                                                {for(int j=0;j<5-(i+1);j++)




                                                                                struct sensus t=city[i];






                                                printf("You enter the Following Data:\n");



                                                                printf("\n CityName:\t%s",city[i].name);

                                                                printf("\n Pupulation:\t%ld",city[i].population);

                                                                printf("\n Litracy Rate=\t%f",city[i].litracy_rate);





Posted Date: 9/29/2012 7:15:08 AM | Location : United States

Related Discussions:- C program to construct a structure , Assignment Help, Ask Question on C program to construct a structure , Get Answer, Expert's Help, C program to construct a structure Discussions

Write discussion on C program to construct a structure
Your posts are moderated
Related Questions
Optimized NIC Driver for Windows Compact 7 for Hard Real Time Communication Project Description: I am seeking an optimized driver (miniport driver) that will be used for sele

#include int main() { int T; int N; int i; scanf("%d",&T)

A: Along with the C++ language, you can overload operators and functions. Overloading is the practice of supplying more than one definition for a provided function name in the same

Write a program to find minimum number of shelves

Mixed Mode Expressions and Implicit type Conversions A mixed mode expression is one in which the operands are not of the similar type. In this case, the operands are converted

A: N delete p is a two-step procedure: it calls the destructor, and then releases the memory. The code developed for delete p is functionally similar to this (supposing p is of typ

Inbuilt Functions i).  Functions to manipulate strings The cstring library defines many functions to perform some manipulation operations with C-styled functions. The followi

assume that the first integer read with cin specifies the number of values remaining to be entered. that program should read only one value each time cin is executed .a typical inp

It''s that spooky time of year when the dead walk the Earth, things go bump in the night, and the Centers for Disease Control (CDC) recognizes the need for zombie preparedness (