codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include<stdio.h> int main() { int i; int choice; char c[2]; printf("please enter your first and last initial : "); scanf("%s",&c); fflush(stdin); printf("\do you want to print first-last or last-first? \n please enter 1 for first-last and enter 2 for last-first \t"); scanf("%d",&choice); if(choice==1) { printf("%c\n%c\n%c%c\n%c%c\n%c%c%c%c\n%c\n%c%c\n%c\n",c[0],c[0],c[0],c[0],c[0],c[0],c[1],c[1],c[1],c[1],c[1],c[1],c[1],c[1]); } else { printf("%c\n%c\n%c%c\n%c%c\n%c%c%c%c\n%c\n%c%c\n%c\n",c[1],c[1],c[1],c[1],c[1],c[1],c[0],c[0],c[0],c[0],c[0],c[0],c[0],c[0]); } }
Private
[
?
]
Run code
Submit