#include<stdio.h>
#include<string.h>
#define MAX_PRODUCTS 100
#define MAX_NAME_LENGTH 50
typedef struct {
    int id;
    char name[MAX_NAME_LENGTH];
    int quanity;
} Product;
Product Products[MAX_PRODUCTS];
int productCount = 0;
void addProduct(int id, char* name, int quantity){
    if(productCount  < MAX_PRODUCTS){
        products[productCount].id = id;
        strcpy(products[productcount].name, name);
        products[productCount].quantity = quantity;
        productcount++;
    } else {
        printf("Maximum product limit reached.\n");
    }
}
void updataQuantity(int id, int quantity){
    for(int i = 0; i < productCount; i++){
        if(products[i]. id == id){
            products[i].quantity = quantity;
            return;
        }
    }
    printf("Product ID %d not found.n\", id);
}
void getProduct(int id){
    for(int i = 0; i < productCount; i++){
        if(products[i].id == id){
            printf("%d %s %d\n", products[i].id,products[i].name, products[i]. quantity);
            return;
        }
    }
    printf("Product ID %d not found.\n", id);
}
int main(){
    addproducts(501, "Apple", 50);
    upadateQuantity(501, 40);
    getproduct(501);
    return 0;
}