Data-Structure Digit Analysis method (Odd Position)


















Data-Structure Digit Analysis method
-------------------------------------------------
-------------------------------------------------
Sample Input: 123456
Sample Output: 531
----------------------------
----------------------------
#include<stdio.h>
int main() {
    int j,x,i,c=0,y,a[10];

    printf(" Please enter key value: ");
    scanf("%d",&j);

    x=j;

    while(x!=0) {

        x=x/10;
        c++;
    }

    for(i=c;i>=1;i--) {

        a[i]=j%10;
        j=j/10;
    }

    printf(" The Index number is: ");

    for(i=c-1;i>=1;i=i-2) {
        printf("%d",a[i]);
    }
}

(By:shahimtiyaj)



SHARE

Shah Imtiyaj

Try to know thyself

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

একটি মন্তব্য পোস্ট করুন