diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 5b186b0..e58fbcd 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -15,4 +15,5 @@ Many thanks to (in alphabetic order): nasciiboy Rafael Bluhm Stevan Cruel - Stonecome \ No newline at end of file + Stonecome + Dilip Puri diff --git a/src/04_25.c b/src/04_25.c new file mode 100644 index 0000000..f589adf --- /dev/null +++ b/src/04_25.c @@ -0,0 +1,13 @@ +/*Solution provided by dilippuri*/ +#include + +int main(void){ + int i; + printf("Decimal\tOctal\tHexadecimal\n"); + + for(i=1;i<=256;i++){ + printf("%d\t%o\t%x\n", i,i,i); + } + + return 0; +} diff --git a/src/04_33.c b/src/04_33.c new file mode 100644 index 0000000..c47a86b --- /dev/null +++ b/src/04_33.c @@ -0,0 +1,70 @@ +/*Solution provided by dilippuri*/ +#include + +int main(void){ + int num; + printf("Enter the num: "); + scanf("%d", &num); + //---------------- + while (num>100) { + printf("C"); + num = num - 100; + } + if (num==100) { + printf("C\n"); + return 0; + } + if (num==99) { + printf("IC\n"); + return 0; + } + //---------------- + while (num>50) { + printf("L"); + num = num - 50; + } + if (num==50) { + printf("L\n"); + return 0; + } + if (num==49) { + printf("IL\n"); + return 0; + } + //---------------- + while (num>10) { + printf("X"); + num = num - 10; + } + if (num==10) { + printf("L\n"); + return 0; + } + if (num==9) { + printf("IX\n"); + return 0; + } + //---------------- + while (num>5) { + printf("V"); + num = num - 5; + } + if (num==5) { + printf("V\n"); + return 0; + } + if (num==4) { + printf("IV\n"); + return 0; + } + //---------------- + while (num>1) { + printf("I"); + num = num - 1; + } + if (num==1) { + printf("I\n"); + return 0; + } + return 0; +} diff --git a/src/04_37.c b/src/04_37.c new file mode 100644 index 0000000..9ca5b12 --- /dev/null +++ b/src/04_37.c @@ -0,0 +1,17 @@ +/*Solution provided by dilippuri*/ +#include + +int main(void){ + int i,j,k; + + for(i=1;i<=5;i++){ + for(j=1;j<=3;j++){ + for(k=1;k<=4;k++){ + printf("*"); + } + printf("\n"); + } + printf("\n"); + } + return 0; +}