26.6.20

c program on arthmetic example 2


POINTER ARTHMETIC EXAMPLE 2
void main()
{
    int a=10,b=20;
    int*p=&a,*q=&b;
    printf("%u,%u\n",p,q);

    printf("%u\n",p+2);
    printf("%u\n",p-2);
   /* printf("%u\n",p*2);  */

    printf("%u\n",q-p);
    /*printf("%u\n",p+q); illegal */
}
OUTPUT
6356724,6356720
6356732
6356716
4294967295

No comments:

Post a Comment

JAVA program pattern 2

import java.util.Scanner; public class pattern3 { public static void main(String args[]) { int i,j; Scanner sc=new Scanner(System.in); Syste...