From de9e963478fa31967ee0de24dd01b06207edf3a0 Mon Sep 17 00:00:00 2001 From: swaaz Date: Fri, 9 Aug 2019 20:51:29 +0530 Subject: [PATCH 1/2] p32 added --- program-31/a.out | Bin 0 -> 16688 bytes program-31/program.c | 12 ++++++------ program-32/program.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 6 deletions(-) create mode 100755 program-31/a.out create mode 100644 program-32/program.c diff --git a/program-31/a.out b/program-31/a.out new file mode 100755 index 0000000000000000000000000000000000000000..22b5b248de5f2e901c594213c81e3558d6bd3792 GIT binary patch literal 16688 zcmeHOeQX>@6`%9j$t8`?myk53ZOApm$SL*3aT3>ohTJ*6WDS?pBymaGr0cWqY+q~N znY(pyN@xuZp~uA`h$014B#Tr~5Qu;%szfUsQp$%4Bo!4%B*;YxI8eaQ52ZkJ{NBvG z^WORl65yx;qnnYXjEJG(Ovha)>GTrR=ME#4!D8}%t9s0A}ybOt0STEulY zuM#(j1>h?srsP3IAXTZqqL_L#?gk~hC$!v2Z_;{9xrRi^ZoagiDul#T=ys4@6$v!& zq+ef1LLr#4yilHBiiL2{6T1FP?RHd^i3Vjiv9*{EX}h886wY=8lig`;cUs#qouLXL zG39ttOz3!4`*qSbGD2cXx|BLDTQSPF-7MKT^mYXcrfm0q*y&Jfjek!#?0a;1^Tnl0 z*Pp3wu2?^i=x*M$ejwH`kVp=XG>o(~H#BbwWKw}9+3w{ip8C|z-JRn5Pk!wa@o)Wf z-OjatTwpzZ6-#;7P99^-<)6AdJ%a_|FDauJm~Xu)l=p z24Krd;H&4s8|T4y%!5A)+>gVVs9TjP_Y`oyQyKhiIM$TF1>)XAVQvQ3fHG31u=s@DZI9PH+x@pTCj3$y| zXQaJ#yV(@Dt&rPP$TbBv3$uOSE;ANS$NLf)E1urBYx_Vd8Q&M}9w2XhgQ=wUW-8T^ zin2WwxXu;w`cfa@>+J&S0?++&Wg<~cchG)~EtkAobZdV2h6K7og%|)&iSK8=|GJhc z{0V)(GVa&7C#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8WY=lj1!(vr3!vcAZ&7nmIS?IK|{u?Y@EU;;lGlER!<( zqsbU;(`mm0TCqgZ9L~gJf_??q8$_W6-<`>5Uvghi@g}3$l5c}5HUV+8X?IY`Ek9IB z6Ljs{k7m74^F$zXXwZswgIZ}t`#FcbOY!uOz>f$k9_ULB2fBw7*m9PLX(-g%-e5)h zgp~D1GyNhEJCuY!MXj`wJP=Q3=>LIK(~JpOIzA931DzWhutY$HA%JY4F9p_$kKjx_ z6iO+1{Q~iR-6#8FaKfB2Rh?5=a2_Q@2NON06J7oQA}j*9F$U4ui|?`jf}{BZh6IfH zD$TcVQ;Vf8=ZU@@2MuX#&+mgw*OHPg@wmuPGctC2es5&zXGKk&_HDrN>m|kI^ZO-J zE}!Q)JWpV^yOE(e4cqg3C{ub)QlfuB6eqUl`Ny5W=#`f3`F)is&zqnk6Zx>Gd%@70 zgzfpgmMPDdxc;oi^nTdW9EW*+|79A~g*of5Veud`6jQe6_hhD%T9M0lw*QE>Z`FEN zwIb6loBj33JME7HqnJ?rWa9S@P4(lErLwLC2AM1lyS-oAG3~G`Bkyo89(CCBdpuLF zFS}u$=@%UKqq+d5H}iy6JK*x!-zkSZ&kLCHe3$j zPl@EYMLX=$furZltvI+kJbqID=DJHmeL6`G2BfXpE E09HJ=r2qf` literal 0 HcmV?d00001 diff --git a/program-31/program.c b/program-31/program.c index c6fbf3d8..43a5fffb 100644 --- a/program-31/program.c +++ b/program-31/program.c @@ -12,7 +12,7 @@ int main() scanf("%d",&n); for(i=1;i<=n;i++) { - printf("Enter the details of student-%d\n",i); + printf("Enter the details of student - %d\n",i); printf("Enter the name of the student\n"); scanf("%s",&stud[i].n); printf("Enter USN\n"); @@ -20,13 +20,13 @@ int main() printf("Enter total marks\n"); scanf("%d",&stud[i].m); } - printf("|\tSl.no\t|\tName\t|\tUSN\t\t|\tMark\t|\n"); + printf("|\tSl.no\t|\tName\t\t|\tUSN\t\t|\tMark\t|\n"); for(i=1;i<=n;i++) { - printf("|\t%d\t|\t%s\t|\t%s\t|\t%d\t|\n",i,stud[i].n,stud[i].u,stud[i].m); + printf("|\t%d\t|\t%-10s\t|\t%s\t|\t%d\t|\n",i,stud[i].n,stud[i].u,stud[i].m); } printf("Enter the details of new student\n"); - printf("Enter the name\n"); //preferred to enter equal length of name + printf("Enter the name\n"); //preferred to enter equal length of name scanf("%s",&stud2.n); printf("Enter the USN\n"); scanf("%s",&stud2.u); @@ -40,10 +40,10 @@ int main() stud[i+1]=stud[i]; } stud[p]=stud2; - printf("|\tSl.no\t|\tName\t|\tUSN\t\t |\tMark\t|\n"); + printf("|\tSl.no\t|\tName\t\t|\tUSN\t\t |\tMark\t|\n"); for(i=1;i<=n+1;i++) { - printf("|\t%d\t|\t%s\t|\t%s\t|\t%d\t|\n",i,stud[i].n,stud[i].u,stud[i].m); + printf("|\t%d\t|\t%-10s\t|\t%s\t|\t%d\t|\n",i,stud[i].n,stud[i].u,stud[i].m); } diff --git a/program-32/program.c b/program-32/program.c new file mode 100644 index 00000000..26b3f3e9 --- /dev/null +++ b/program-32/program.c @@ -0,0 +1,29 @@ +#include +struct student +{ +char n[100]; +char u[100]; +int m; +}stud[10],stud2; +int main() +{ + int n,i,p=0; + printf("Enter the number of student\n"); + scanf("%d",&n); + for(i=1;i<=n;i++) + { + printf("Enter the details of student - %d\n",i); + printf("Enter the name of the student\n"); + scanf("%s",&stud[i].n); + printf("Enter USN\n"); + scanf("%s",&stud[i].u); + printf("Enter total marks\n"); + scanf("%d",&stud[i].m); + } + printf("|\tSl.no\t|\tName\t\t|\tUSN\t\t|\tMark\t|\n"); + for(i=1;i<=n;i++) + { + printf("|\t%d\t|\t%-10s\t|\t%s\t|\t%d\t|\n",i,stud[i].n,stud[i].u,stud[i].m); + } + return 0; +} From c66554a0199a64eb86e4979ab1da32ab3b9c8eb4 Mon Sep 17 00:00:00 2001 From: Swasthik shetty <42874695+swaaz@users.noreply.github.com> Date: Fri, 9 Aug 2019 21:01:28 +0530 Subject: [PATCH 2/2] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index df158a98..ec3de6b1 100644 --- a/README.md +++ b/README.md @@ -32,4 +32,5 @@ | Program-28 | Program to print the pattern | | Program-29 | Program to print the pattern | | Program-30 | Program to print the pattern | -| Program-31 | Program to print the details of students using array and to add details of new students into the existing array | +| Program-31 | Program to take the details of student and print the details of students using array and to add details of new students into the existing array | +| Program-31 | Program to take the details of student and print the details |