ഇങ്ങോട്ട് നോക്കു

വഴി തെറ്റി വന്നവര്‍

Powered By Blogger

Google Profile

My photo
KAYAMKULAM, KERALA, India
Hi, I’m Renjith Krishnan, a tech enthusiast from Kayamkulam (India), and this my personal page. I write some technological contents , just the things that interested me during the daily life and some automated updates pulled from other sites . If you were looking for my site ,and wanna read some tech stuffs then please go here www.renjith007.co.cc I update my status on twitter [@renjith0007], orkut [@renjith krishnan], FB [@renjith krishnan], some times in skype [@kichuse1] and if you like my stuffs,add me to your network. It’s exciting to meet new people.

വിളികുവോ ആവൊ

Skype Me™!

* * എല്ലാവര്‍ക്കും എന്‍റെ ബ്ലോഗിലേക് സ്വാഗതം * *

Program to print array element in reverse order in C Language


     #include<conio.h>



#include<stdio.h>

#include<stdlib.h>

 

int main()

{

    int *ptr,i,n;

    clrscr();

    printf("Enter the no of elements:");

    scanf("%d",&n);

    ptr=(int *)malloc(sizeof(int)*n);

    if(ptr==NULL)

    {

        printf("Not enough memory");

        exit(1);

    }

    for(i=0; i<n; i++)

    {

        printf("Enter %d element : ",i+1);

        scanf("%d",&ptr[i]);

    }

    printf("Array in original order\n");

    for(i=0; i<n; i++)

    {

        printf("%d\n",ptr[i]);

    }

    printf("Array in reverse order\n");

    for(i=n-1; i>=0; i--)

    {

        printf("%d\n",ptr[i]);

    }

    getch();

  return 0;

0 comments:

തിരയുക

എന്നോട് കൂട്ട് കൂടാമോ ?

വിരുന്നുവന്നവര്‍