Skip to main content

Posts

Showing posts from October, 2013

Difference between Java and C++

How Java is different from C++ 1.       Java does not support “goto”, “sizeof”, and “typedef” keywords. 2.       Java does not support keywords like “auto”, “extern”, “register”, “signed”, and “unsigned”. 3.       Java does not support any pre-processor like #define, #include. 4.       Java does not support operator overloading. 5.       Java does not support template class. 6.       Java does not support multiple inheritance. 7.       Java does not support global variable. 8.       Java does not support pointers as in C++. 9.       Java replace destructor() function with finalize() method. 10.   There are no header files in Java. 11.   Java is a highly case sensitive language.

Swap two numbers using Pointers in C programming

#include<stdio.h> #include<conio.h> void swap(int*,int*); void main() {   int a,b;   clrscr();   printf("enter first number  :");   scanf("%d",&a);   printf("enter second number :");   scanf("%d",&b);   clrscr();   printf("Before swapping\n\t\ta=%d\n\n\t\tb=%d",a,b);   swap(&a,&b);   printf("\n\nAfter swapping\n\t\ta=%d\n\n\t\tb=%d",a,b);   getch(); }     void swap(int *x,int *y)   {     int z;     z=*y;     *y=*x;     *x=z;    }