Program to illustrate Computer info

#include <iostream.h>
#include <conio.h>
struct COMPUTER
{
    char CPUtype[15],CDROM_type[10],mouse_type[15];
    char key_board_type[15],SVGA_monitor_make[15];
    int SDRAM_size,HDD_size;
    float clock_speed,CDROM_speed;
}    comp[50];
void main()
{
    int i;
    clrscr();
    for(i=0;i<50;i++)
    {
        cout<<"\nEnter CPU tpye, CDROM_type, mouse_type";
        cin>>comp[i].CPUtype>>comp[i].CDROM_type>>comp[i].mouse_type;
        cout<<"Enter key_board_type, SVGA_monitor_make";
        cin>>comp[i].key_board_type>>comp[i].SVGA_monitor_make;
        cout<<"Enter SDRAM_size, HDD_size";
        cin>>comp[i].SDRAM_size>>comp[i].HDD_size;
        cout<<"Enter clock_speed, CDROM_speed";
        cin>>comp[i].clock_speed>>comp[i].CDROM_speed;
        }
        for(i=0;i<50;i++)
        {
            if(comp[i].HDD_size> 8)
            {
                cout<<"CPU type is "<<comp[i].CPUtype;
            }
        }
}

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|