Q1. Rewrite the Shopping list program using gotoxy.
#include<stdio.h> #include<conio.h> void main() { int a1=1, a2, a3, a4; int b1=2, b2, b3, b4; int c1=3, c2, c3, c4; int i; char t2[]={"Total"}; int t3, t4, t5, tp1, tp2, tp3, gt; char s1[]={"S.No."}; char s2[]={"item code"}; char s3[]={"quantity"}; char s4[]={"price"}; char s5[]={"Total price"}; clrscr(); printf("Enter the item code: "); scanf("%d",&a2); printf("Enter the quantity: "); scanf("%d",&a3); printf("Enter the price"); scanf("%d",&a4); printf("Enter the item code: "); scanf("%d",&b2); printf("Enter the quantity: "); scanf("%d",&b3); printf("Enter the price: "); scanf("%d",&b4); printf("Enter the item code: "); scanf("%d",&c2); printf("Enter the quantity: "); scanf("%d",&c3); printf("Enter the price: "); scanf("%d",&c4); clrscr(); tp1=a3*a4; tp2=b3*b4; tp3=c3*c4; printf("\n\n\n ------- Shopping Center ------ \n\n\n\n"); printf("%10s %15s %15s %10s %18s\n",s1,s2,s3,s4,s5); gotoxy(5,5); printf("%d",a2); gotoxy(5,6); printf("%d",b2); gotoxy(5,7); printf("%d",c2); gotoxy(7,5); printf("%d",a3); gotoxy(7,6); printf("%d",b3); gotoxy(7,7); printf("%d",c3); gotoxy(9,5); printf("%d",a4); gotoxy(9,6); printf("%d",b4); gotoxy(9,7); printf("%d",c4); t3=a3+b3+c3; t4=a4+b4+c4; gt=tp1+tp2+tp3; printf("\n---------------------------------------------------------------------------"); printf("\n%20s %20d %11d %19d",t2,t3,t4,gt); printf("\n---------------------------------------------------------------------------"); getch(); }