int * gred ;
gred = new int [100] ; // this example snippet creates 100 ints
To dynamically allocate memory, use the following function (stdlib.h I believe): int *variable1 = malloc(sizeof(int));
In QBASIC, you can use the INPUT statement to read data for your name, age, and address. Here's a simple program example: DIM name AS STRING DIM age AS INTEGER DIM address AS STRING INPUT "Enter your name: ", name INPUT "Enter your age: ", age INPUT "Enter your address: ", address PRINT "Name: "; name PRINT "Age: "; age PRINT "Address: "; address This program prompts the user to enter their name, age, and address, then prints the collected information.
Pointers are data types that hold integer values, those "integer" values are simply addresses of another variables.Example:int x = 15; // this is an integer variable with value 15int* ptr; // this is a pointer to an integerptr = &x; // now we assigned the address of x to the pointer ptr// if you want to access the value of x (15 in this example),// you should use the deterrence *// so you can say:printf("%d", *ptr); // this will print 15// you can print the value of ptr (which is the address of x) using:printf("%p", ptr); // this will print an integer, which is the address of x.==========================================================More explanation, let's imagine that this is a memory:-00--01-02-03-04 =====> these are the address of the memory|--- |--- |---|---|---| =====> values inside the memoryFor the example I gave before, let's imagine the following:-00-01-02--03--04|---|15|--- | 01 |---|------x------- ptrAs you can see, x hold the value 15, ptr holds the value 01 which is actually the address of x. Now ptr have a distinct address too, which is 03.In reality, the address of a memory is longer, and usually represented as hexadecimal values. example 0x002154You can find more information here:http://en.wikipedia.org/wiki/Pointers
Data type is mandatory in every variable-declaration.Example:int i; -- integerint *pi; -- integer-pointerint ai[10]; -- integer-arrayint *api[10]; -- array of integer-pointersint (*api)[10]; -- pointer to integer-array
C++ Provides a multiple branch selection called as switch. This selection statement succesively test against a list of integer or character constants. When a match is found the statements associate with constants are executed. When no match is found default statement is used.
To dynamically allocate memory, use the following function (stdlib.h I believe): int *variable1 = malloc(sizeof(int));
the square of an integer will always be an integer
5
The statement is not true. Disprove by counter-example: 3 is an integer and 5 is an integer, their product is 15 which is odd.
Any fraction p/q where p is an integer and q is a non-zero integer is rational.
The statement is false.
True. The first statement is true and the second statement is false. In a disjunction, if either statement is true, the disjunction is true.
The let statement is: let the smallest of the three integers be x.
It is an invalid statement.
"Arbitrary" simply means any. So this refers to any positive integer. It may be used to make a statement that is true for every positive integer.
The statement is: "Their sum is always an integer." Whether the sum is negative or positive depends on the two original integers.
In QBASIC, you can use the INPUT statement to read data for your name, age, and address. Here's a simple program example: DIM name AS STRING DIM age AS INTEGER DIM address AS STRING INPUT "Enter your name: ", name INPUT "Enter your age: ", age INPUT "Enter your address: ", address PRINT "Name: "; name PRINT "Age: "; age PRINT "Address: "; address This program prompts the user to enter their name, age, and address, then prints the collected information.