C++ Program to Solve Knapsack Problem by krbutani
C++ Program to Solve Knapsack Problem by krbutani #include<stdio.h> #include<conio.h> float m,p[100],w[100],r[100]; void main() { clrscr(); int n; void swap(int,int); float cal(int); printf("\n\t Enter Capacity of Bag : "); scanf("%f",&m); printf("\n\t Enter How Many Item Deatils : "); scanf("%d",&n); clrscr(); printf("\n\t Enter the 3 Item Data : "); for(int i=0;i<n;i++) { printf("\n\t Enter %dth Item Weight : ",i); scanf("%f",&w[i]); printf("\n\t Enter %dth Item Profit : ",i); scanf("%f",&p[i]);