Programming Blog

This blog is about technical and programming questions and there solutions. I also cover programs that were asked in various interviews, it will help you to crack the coding round of various interviews

Saturday 13 January 2018

Operation on pointers

#include<stdio.h>
#include<conio.h>
void main()
{
int *ptri, *ptrd, i;
clrscr();
ptri = ptrd = 1000;
printf("Incrementing Integer Pointer...\n");
for(i=0; i<5; i++)
{
printf("%d\n", ptri);
ptri++;
}
printf("\n");
printf("Decrementing Integer Pointer...\n");
for(i=0; i<5; i++)
{
printf("%d\n", ptrd);
ptrd--;
}
getch();
}

No comments:

Post a Comment