Friday, September 16, 2011

Java versus C versus C++


Note:
1)      In java we can return an array of character as the return type of a function.
Eg : char[] display()
   {
      char[] ch = {‘a’, ‘b’, ‘c’};
      ch[1] = ‘A’;
      ch[0] = ‘B’;
      return ch;
   }

Guess???
Can we return an array of character in C and CPP without using pointer?

2)      We cannot have “>>” between integer values.

Guess???
Can we do the same in C and CPP?

3)      In C and CPP, 0 is treated as false and positive numbers as true.

Guess???
Is it the same in Java?

4)      We cannot have an inbuilt output function inside a System.out.println() in Java.

Guess???
Can we have such things in C and CPP?

5)      How can we print “//” using a printf() or cout or println()?



Please drop me a mail to get the answer to kleponymanipur@gmail.com
Further for such differences, notes write to kleponymanipur@hotmail.com
For any further improvement in this blog, please write to klepony_manipur@yahoo.co.in


No comments:

Post a Comment