05-16-2011, 08:14 PM
here is my today's CS201 Paper
Consider the structure 2 Marks
struct Customer
{
int custnum;
int salary;
float commission;
};
A programmer wants to assign 2000 for the structure member salary in the above example of structure Customer with structure variable cust1 What line of code should he write
Why are arrays usually processed with for loop? 2 Marks
What are the basic steps of file handling? 3 Marks
When a pointer is incremented, what happens in the following cases? 3 Marks
a) Single-dimensional array
b) Two-dimensional array
If int array[10]; is an integer array then write the statements which will store values at Fifth and Ninth location of this array. 5 Marks
Write down the output of the code given below : 5 Marks
Hint:
Size of char is 1 byte
Size of int is 2 byte
Size of float is 4 byte
#include <iostream.h>
union mytypes_t {
char c;
int i;
float f;
} mytypes;
int main(){
mytypes.c = 'H';
mytypes.i = 15;
cout << sizeof(mytypes)<<endl;
mytypes.i = 15;
mytypes.c = 'H';
cout << sizeof(mytypes)<<endl;
system("PAUSE");
return 0;
}
Consider the structure 2 Marks
struct Customer
{
int custnum;
int salary;
float commission;
};
A programmer wants to assign 2000 for the structure member salary in the above example of structure Customer with structure variable cust1 What line of code should he write
Why are arrays usually processed with for loop? 2 Marks
What are the basic steps of file handling? 3 Marks
When a pointer is incremented, what happens in the following cases? 3 Marks
a) Single-dimensional array
b) Two-dimensional array
If int array[10]; is an integer array then write the statements which will store values at Fifth and Ninth location of this array. 5 Marks
Write down the output of the code given below : 5 Marks
Hint:
Size of char is 1 byte
Size of int is 2 byte
Size of float is 4 byte
#include <iostream.h>
union mytypes_t {
char c;
int i;
float f;
} mytypes;
int main(){
mytypes.c = 'H';
mytypes.i = 15;
cout << sizeof(mytypes)<<endl;
mytypes.i = 15;
mytypes.c = 'H';
cout << sizeof(mytypes)<<endl;
system("PAUSE");
return 0;
}
0300-9520262
Get solution in 24 hour |cpmputer & internet
mileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
