Simple

How to Swap Two Numbers Without Using Temporary Variable or Arithmetic Operators?

You have done swapping of two numbers using temporary variable or by using arithmetic operators. It can be done in following way. Lets take two numbers a=5 and b=7. Using Temporary Variable temp=a;            //temp becomes 5 a=b;                 //a becomes 7 b=temp;            //b becomes 5 Also Read: C++ program to swap two numbers using pointers Also Read: C++ …

How to Swap Two Numbers Without Using Temporary Variable or Arithmetic Operators? Read More »

Java program to swap two numbers

class Swap { public static void main(String…s) { int a,b,temp; a=Integer.parseInt(s[0]); b=Integer.parseInt(s[1]); System.out.println(“nBefore Swap:n”+”a=”+a+”tb=”+b); temp=a; a=b; b=temp; System.out.println(“nAfter Swap:n”+”a=”+a+”tb=”+b); } }

C program to print size of different data types

#include<stdio.h> #include<conio.h> void main() { clrscr(); printf(“TypettttSize (bytes)”); printf(“nCharacterttt    %d”,sizeof(char)); printf(“nIntegertttt    %d”,sizeof(int)); printf(“nLong intttt    %d”,sizeof(long int)); printf(“nFloattttt    %d”,sizeof(float)); printf(“nDoubletttt    %d”,sizeof(double)); printf(“nLong doublettt    %d”,sizeof(long double)); getch(); }