OSA C1



C1 :Write program to find number of CPU cores and CPU Manufacturer


  Program : 
 
#include <iostream>
#include <stdlib.h>
using namespace std;
main()
{    
string name;
string name1;
cout<<"No. of CPU cores:\n";
name = system ("nproc");
cout<<name;
cout<<"Information about CPU:\n";
name1 = system ("lscpu");
cout<<name1;
}
 
·        
 Output :
 
[student@localhost ~]$ gedit 1.cpp
[student@localhost ~]$ g++ 1.cpp
[student@localhost ~]$ ./a.out
No. of CPU cores:
2
Information about CPU:
Architecture:          i686
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                2
On-line CPU(s) list:   0,1
Thread(s) per core:    1
Core(s) per socket:    2
Socket(s):             1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 23
Model name:            Intel(R) Core(TM)2 Duo CPU     E7500  @ 2.93GHz
Stepping:              10
CPU MHz:               1867.000
BogoMIPS:              5852.45
Virtualization:        VT-x
L1d cache:             32K

0 comments:

Post a Comment