Agarda, value o’zgaruvchisiga butun turdagi binary faylni ta’minlamoqchi bo’lsangiz, u holda_______ kabi kiritasiz.
chiqarish uchun fayl ko’rsatkichini ko’chiruvchi ______funksiyasidan foydalanamiz
OPERATORLARNI QAYTA YUKLASH Quyidagilarning qaysi biri rational obyektini yaratadi?
Dastur wqanday natijani chop etadi?
#include #include "Rational.h"
using namespace std;
int main()
{
cout << Rational().toString();
return 0;
} Dastur wqanday natijani chop etadi?
#include #include "Rational.h"
using namespace std;
int main()
{
Rational r1(1, 2);
Rational r2(1, 3);
cout << r1.add(r2).toString() << endl;
return 0;
} A. 5/6; B. ½; C. 1/3; D. 1/6
Dastur wqanday natijani chop etadi?
#include #include "Rational.h"
using namespace std;
int main()
{
Rational r1(1, 2);
cout << r1.doubleValue();
return 0;} Ikkita ratsional obyektini bir biriga taqqoslash ____funksiyasi orqali amalga oshiriladi.
Quyidagi operatorlardan qaysi birini qayta yuklash mumkin?
Agar +=operatori quyidagi obrazda realizatsiya qilinsa qanday hatolik bo’lishi mumkin?
Rational Rational::operator+=(Rational& secondRational)
{
this->add(secondRational);
return this; } r Rational sinfining obyekti bo’lishi uchun_____ ko’rinishda bo’ladi.
Qaysi javobda index[] operatorini qayta yuklash to’g’ri ko’rsatilgan?
A. long Rational::operator[](const int& index)
B. long& operator[](const int& index);
C. &long operator[](const int& index);
D. long operator&[](const int& index);
Qaysi javobda “+” operatorini qayta yuklash to’g’ri ko’rsatilgan?
A. Rational Rational::operator+(const Rational& r)
B. Rational Rational::operator+()
C. Rational Rational::operator<+>(const Rational& r)
D. Rational Rational::operator(+)(const Rational& r)
Qaysi javobda “++” operatorini qayta yuklash to’g’ri ko’rsatilgan?
A. Rational operator++(Rational& r)
B. Rational operator++()
C. Rational operator++(int dummy)
D. Rational operator++(int& dummy)
Quyidagi dasturni tahlil qiling:
#include using namespace std;
class Date
{
friend void p();
private:
int year;
int month;
int day;
};
void p()
{
Date date;
date.year = 2000;
cout << date.year;
}
int main()
{
p();
return 0;
}
Qaysi javobda “>>” operatorini qayta yuklash to’g’ri ko’rsatilgan?