Professional Documents
Culture Documents
INF212 Introduction To Programming Laboratory Leaflet: Student
INF212 Introduction To Programming Laboratory Leaflet: Student
INF212 Introduction To Programming Laboratory Leaflet: Student
INTRODUCTION TO PROGRAMMING
LABORATORY LEAFLET
STUDENT
Task Statement
main() {
unsigned int a = 60; // 60 = 0011 1100
unsigned int b = 13; // 13 = 0000 1101
int c = 0;
c = a | b; // 61 = 0011 1101
cout << "Line 2 - Value of c is: " << c << endl ;
c = a ^ b; // 49 = 0011 0001
cout << "Line 3 - Value of c is: " << c << endl ;
return 0;
}
int main()
{
cout << "Binary reprsentations of numbers:\n";
bitset<4> x = 32 ;
cout<<"x = " << x << endl ;
bitset<6> y = 32 ;
cout<<"y = " << y << endl ;
bitset<8> z = 32 ;
cout<<"z = " << *** << endl ;
cout<<endl;
cout<< "Conversion to integer\n" ;
cout<<"x = " << x.to_ulong() << endl;
cout<<"y = " << *********() << endl;
cout<<"z = " << z.to_ulong() << endl;
cout<<endl;
cout<< "Conversion to string\n" ;
string sx = ***********() ;
string sy = y.to_string() ;
1
Son duzenleme: 15.03.2021
Electronics Engineering INF212
string sz = z.to_string() ;
return 0;
}
int main(){
2
Son duzenleme: 15.03.2021
Electronics Engineering INF212
return 0;
}
Quiz
FOY HAKKINDA:
Islem Yapan
Hazirlama
Emrah Sever
22.05.2018
Revizyon
Süleyman TUNÇEL
15.03.2021
3
Son duzenleme: 15.03.2021