ACP2_10

#include<stdio.h> void main() { struct{ char name[20]; float total; struct{ int men,women; }pop; }state; clrscr(); //input data printf("\nEnter state name : "); flushall(); gets(state.name); printf("Total population : "); flushall(); scanf("%f",&state.total); printf("Population - Men (%) : "); flushall(); scanf("%d",&state.pop.men); printf("Population - Women (%) : "); flushall(); scanf("%d",&state.pop.women); clrscr(); //display data printf("\nState\t\t - %s",state.name); printf("\nPopulation\t - %6.2f",state.total); printf("\nMen\t\t - %d%",state.pop.men); printf("\nWomen\t\t - %d%",state.pop.women); getch(); } void force() { float x,*y; y=&x; x=*y; }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.