Computerscience
- Write a c++ program to accept 10 integers in an array and find its sum and average? #include<iostream.h> int main() { int arr[10]; int i,sum=0; float avg; cout<<"enter 10 number"; for(i=0;i<10;i++) { cin>>arr[i]; } for(i=0;i... 2
- Write a c++ function to find surface area of sphere? Surface area of a sphere = 4π r²; write a C++ function that takes the radius and returns this value. #include <iostream> using namespace std... 1
- Write a C++ program to find sum of first 100 natural numbers? #include <iostream> using namespace std; int main() { int sum = 0; // loop through the first 100 natural numbers and add them to sum for (in... 1
- Write a program in C++ to read data variables day, month, and year of a class date by the member function and display #include <iostream> using namespace std; class Date { private: int day; int month; int year; public: // member function to read date variabl... 1
- Write a program in C++ to overload binary + operator for addition of complex numbers? #include <iostream> using namespace std; class Complex { private: double real; double imag; public: Complex() { real = 0; imag = 0; } Comple... 1
- Write a program in C++ which implements data conversion from one class to another.? #include <iostream> using namespace std; class Feet { private: int feet; public: Feet() { feet = 0; } Feet(int f) { feet = f; } // conversio... 1
- Write a class in c++ to demonstrates the example of Single inheritance? #include <iostream> using namespace std; // Base class class Shape { protected: int width; int height; public: void setWidth(int w) { width... 1
- Write a class in c++ to demonstrates the example of multilevel inheritance? #include <iostream> using namespace std; // Base class class Vehicle { public: Vehicle() { cout << "This is a vehicle." << endl; } }; // Der... 1
- Write a C++ program that will read a line of text and count the number of words in a text. Answer: read the whole line with getline, then count each place where a word starts (a non-space character after a space or at the beginning... 1
- Write a program in C++ that inputs and stores 10 numbers in an array and prints the sum and average of the array element #include <iostream> using namespace std; int main() { int numArray[10]; int sum = 0; double avg; // Input numbers into array for (int i = 0;... 1
- Write a program in c++ for addition of two matrices? #include <iostream> using namespace std; const int ROWS = 2; const int COLS = 3; void addMatrices(int m1[][COLS], int m2[][COLS], int result... 1
- Write a c++ program for overloading of unary + operator? #include <iostream> using namespace std; class Number { private: int num; public: Number() { num = 0; } Number(int n) { num = n; } // Overlo... 1
- Write a c++ program using constructor and destructor to find factorial of a given number? a c++ program using constructor and destructor to find factorial of a given number 2
- Write a program in C++, to check if the given number is a prime number . #include <iostream> using namespace std; int main() { int i, n; bool is_prime = true; cout << "Enter a positive integer: "; cin >> n; // 0 a... 1
- Write a program in C++, to count the number of words in a line of text #include <iostream> #include <string> using namespace std; int main() { string line; int count = 0; cout << "Enter a line of text: "; getlin... 1
- In terms of GUI, what is window? Explain in short various operations performed on a window. In graphical user interface (GUI) design, a window is a rectangular area on the screen that displays the output of an application or program... 1
- Device drivers are ____________ i) Software programs ii) Viruses iii) Scanners iv) Devices used to run CD Device drivers are _ Software programs 2
- Time taken to adjust the appropriate sector under read /write head in disk is called as ____________ Time taken to adjust the appropriate sector under read /write head in disk is called as Latency time. 1
- Concentric circles on disk surface are known as ____ Concentric circles on disk surface are known as Tracks . 2
- In Magnetic tapes __________ access method is used. i) Direct ii) Random In Magnetic tapes Sequential access method is used 2
- _______ is a free operating system. i) Unix ii) Linux iii) Mac OS iv) MS Windows Linux is a free operating system. 2
- Windows 98 is a __________ operating system. i) Single user multitasking ii) Uni-programming iii) Multiuser Single user multitasking 2
- _______is a service of memory management of operating system. Allocate a chunk of memory 2
- Program under execution is known as __________. i) File ii) Information iii) Data iv) Process Program under execution is known as Process 2