Monday, May 30, 2011
LEARN C IN 24 HOURS
DOWNLOAD NOW
IF IT DOESN'T HELP, THEN JUST MUG UP THE PROGRAMS BELOW
DOWNLOAD PROGRAMS NOW
Thursday, May 19, 2011
ALL IMPORTANT ITP PROGRAMS
QUITE SUFFICIENT FOR ITP PAPER...
DOWNLOAD NOW
Wednesday, May 18, 2011
PREVIOUS YEAR END TERM QUESTION PAPERS
QUITE USEFUL
so download now.......
DOWNLOAD NOW
Saturday, April 2, 2011
MECHANICS ASSIGNMENT SOLVED (TO BE SUBMITTED ON MONDAY)
download now....
Friday, April 1, 2011
ITP ASSIGNMENT(TO BE SUBMITTED ON MONDAY)
Sunday, March 27, 2011
C INTERVIEW QUESTIONS
The C programming language is a standardized programming language
developed in the early 1970s by Ken Thompson and Dennis Ritchie for
use on the UNIX operating system. It has since spread to many other
operating systems, and is one of the most widely used programming
languages. C is prized for its efficiency, and is the most popular
programming language for writing system software, though it is also
used for writing applications.
printf() Function
2)What is the output of printf("%d")?
1. When we write printf("%d",x); this means compiler will print the
value of x. But as here, there is nothing after %d so compiler will show
in output window garbage value.
2. When we use %d the compiler internally uses it to access the
argument in the stack (argument stack). Ideally compiler determines
the offset of the data variable depending on the format specification
string. Now when we write printf("%d",a) then compiler first accesses
the top most element in the argument stack of the printf which is %d
and depending on the format string it calculated to offset to the actual
data variable in the memory which is to be printed. Now when only %d
will be present in the printf then compiler will calculate the correct
offset (which will be the offset to access the integer variable) but as
the actual data object is to be printed is not present at that memory
location so it will print what ever will be the contents of that memory
location.
3. Some compilers check the format string and will generate an error
without the proper number and type of arguments for things like
printf(...) and scanf(...).
3) What will be printed as the result of the operation below:
main()
{
int x=20,y=35;
x=y++ + x++;
y= ++y + ++x;
printf(“%d%dn”,x,y);
}
Answer : 5794
4) What will be printed as the result of the operation below:main()
{
int x=5;
printf(“%d,%d,%dn”,x,x< <2,x>>2);
}
Answer: 5,20,1
5)What will be the result of the following code?
#define TRUE 0 // some code
while(TRUE)
{
// some code
}
Answer: This will not go into the loop as TRUE is defined as 0.
6)What will be printed as the result of the operation below:
int x;
int modifyvalue()
{
return(x+=10);
}
int changevalue(int x)
{
return(x+=1);
}
void main()
{
int x=10;
x++;
changevalue(x);
x++;
modifyvalue();
printf("First output:%dn",x);
x++;
changevalue(x);
printf("Second output:%dn",x);
modifyvalue();
printf("Third output:%dn",x);
}
Answer: 12 , 13 , 13
7)What will be printed as the result of the operation below:
main()
{
int x=10, y=15;
x = x++;
y = ++y;
printf(“%d %dn”,x,y);
}
Answer: 11, 16
8)What will be printed as the result of the operation below:
main()
{
int a=0;
if(a==0)
printf(“Cisco Systemsn”);
printf(“Cisco Systemsn”);
}
Answer: Two lines with “Cisco Systems” will be printed.
9)What is inheritance?
Inheritance allows one class to reuse the state and behavior of another class. The derived class inherits the properties and method implementations of the base class and extends it by overriding methods and adding additional properties and methods.
10)What is Polymorphism??
Polymorphism allows a client to treat different objects in the same way even if they were created from different classes and exhibit different behaviors.
You can use implementation inheritance to achieve polymorphism in languages such as C++ and Java.
Base class object's pointer can invoke methods in derived class objects.
You can also achieve polymorphism in C++ by function overloading and operator overloading.
11)What is constructor or ctor?
Constructor creates an object and initializes it. It also creates vtable for virtual functions. It is different from other methods in a class.
12)What is destructor?
Destructor usually deletes any extra resources allocated by the object.
13)What is default constructor?
Constructor with no arguments or all the arguments has default values.
14)What is copy constructor?
Constructor which initializes the it's object member variables ( by shallow copying) with another object of the same class. If you don't implement one in your class then compiler implements one for you.
for example:
Boo Obj1(10); // calling Boo constructor
Boo Obj2(Obj1); // calling boo copy constructor
Boo Obj2 = Obj1;// calling boo copy constructor
14)When are copy constructors called?
Copy constructors are called in following cases:
a) when a function returns an object of that class by value
b) when the object of that class is passed by value as an argument to a function
c) when you construct an object based on another object of the same class
d) When compiler generates a temporary object