array calculation error need help
hello im having problem with the program question below, it compiles but the calculations are giving wrong values, the program is reading in 10 integers from the user and adding one to the first value two to the second value and three to the third value and so on...... and the second part is de encrypting i would be grateful if someone can figure out what i am doing wrong thanks
Code:
#include<stdio.h>
main(){
int numb[10],i;
int choice;
printf("What would you like to do?\n");
printf("1. Encrypt a string \n");
printf("2. De-encrypt a string\n");
scanf("%d",&choice);
switch(choice)
case 1:
{
printf("Enter your 10 values to encrypt: \n");
for(i=0;i<9;i++)
scanf("%d\n",&numb[i]);
printf("\n");
printf("Encrypted numbers are: \n");
for(i=0;i<9;i++){
printf("%d\n",numb[i]);
numb[0]=numb[0]+1;
numb[1]=numb[1]+2;
numb[2]=numb[2]+3;
numb[3]=numb[3]+4;
numb[4]=numb[4]+5;
numb[5]=numb[5]+6;
numb[6]=numb[6]+7;
numb[7]=numb[7]+8;
numb[8]=numb[8]+9;
numb[9]=numb[10]+10;
}
case 2:
printf("Enter your 10 values to De-encrypt: \n");
for(i=0;i<9;i++)
scanf("%d\n",&numb[i]);
printf("\n");
printf("De-encrypted numbers are: \n");
for(i=0;i<9;i++){
printf("%d\n",numb[i]);
numb[0]=numb[0]-1;
numb[1]=numb[1]-2;
numb[2]=numb[2]-3;
numb[3]=numb[3]-4;
numb[4]=numb[4]-5;
numb[5]=numb[5]-6;
numb[6]=numb[6]-7;
numb[7]=numb[7]-8;
numb[8]=numb[8]-9;
numb[9]=numb[9]-10;
}
}
}