C

Monday, 26 June 2017

Program to access an array using a pointer

#include<stdio.h>
main()
{        
          int a[]={10,20,30,40,50};
          int i,* j;
           j=a;
           clrscr();
          for(i=0;i<5;++i)
          {
                   printf("\nElement no. is %d and address is                                 %u",*j,j);
                   j++;
          }

}

No comments:

Post a Comment

Write a program to draw a circle using mid-point circle drawing algorithm.

#include<iostream.h> #include<graphics.h> #include<conio.h> void drawcircle(int x0, int y0, int r) {         ...