-
Notifications
You must be signed in to change notification settings - Fork 9
/
printnum.c
41 lines (34 loc) · 883 Bytes
/
printnum.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/***********************************************************
* You can use all the programs on www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact [email protected]
* To find more C programs, do visit www.c-program-example.com
* and browse!
*
* Happy Coding
***********************************************************/
/*
* print 1
* 232
* 34543
* 4567654
* 567898765
*/
#include<stdio.h>
void display(int start, char *str){
int i,j;
for(i=start; i<=(start+start); i++)
printf("%c",str[i]);
for(j=i-2;j>=start;j--)
printf("%c",str[j]);
}
main(){
char str[]="123456789";
int i, j;
for(i=0;i<5;i++){
display(i, str);
printf("\n");
}
}
/* https://github.com/snadahalli/cprograms */