Write a piece of code that dynamiccaly creates 1) a 1d char array of size 100 and 2) a 2d array having 4 rows where the first row has only one cell, second row has two cells, third row has three cell, fourth row has four cells. Now write the code to delete the arrays.
What is the size of an int variable and a char variable. What is the size of a variable which points to an int and a variable that points to a char. Now write a piece of code that displays the sizes of the data types mentioned above.
Write the output of the following
int main(){
int array[5]={5,960,87,30,22};
int *aptr = array;
cout << array[0] << *array << *aptr<<endl;
cout << array[4] << *array + 4 << *(array+4) << *(aptr+4);
}
Write a function which takes as argument two integers and prints all the prime numbers between those two numbers. If the first number is smaller than the second, the prime numbers would be displayed in an increasing order. If the first number is bigger than the second, the prime numbers would be displayed in an decreasing order.
Receive 3 numbers and display them in ascending order from smallest to largest
Draw a circle using line command in qbasic programming language
Write a C++ program that contain the following
functions:
a) Function travelCharge(char,int,int): this function will calculate and return the traveling
cost based on the given table.
Vacation Places Places ID Adult (RM) Children (RM)
Pangkor Island P 350 175
Bukit Merah B 200 100
Teluk Batik T 80 40
b) Function hotelCharge(int,int): this function will receives vacation packages as input
from the user. Then, calculate and return the hotel charge. The hotel charge (per room) is
based on the given table.
Vacation Packages Package ID Price per day and per room (RM)
Deluxe D 430
Standard S 270
Economy E 100
c) Write the main program to input the customer’s name, vacation places (P, B or T), number
of adults in the group, number of children in the group, number of days going for vacation
and number of hotel rooms booked. Then, by using functions above, calculate the cost for
travel and hotel. Finally, display the total payment a customer has to pay.
how many 60KB jpg files can be stored on a 2MB folder in your hard drive?
Write a program to output the following
___
( ‘ ‘ )
( (
) )
( (
) )
( (
) )
( (
) )
V