[ create a new paste ] login | about

Link: http://codepad.org/BL6JDShq    [ raw code | output | fork ]

C, pasted on Jun 27:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include<stdio.h>

int main(){
    int a[]={1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int n = 10, i;
printf( "Introduceti un intreg intre 1 si 10: \n");

for (i=0; i< n; i++)
switch (a[i])
{

case 5: printf("%d ", ++ i ) ;
case 10: printf("-%d ", ++ i );
default: printf("%d ", i );
}
return(0);
}


Output:
1
2
Introduceti un intreg intre 1 si 10: 
0 1 2 3 5 -6 6 7 8 -10 10 


Create a new paste based on this one


Comments: