A birthday boy wants to share pens and pencils to all the class memebers equally only if the pens and pencils and girls are equal to share....
HERE IS THE CODING QUESTION THAT I GOT IN TCS NQT 2024!!!!!
#include int main() { int pens, pencils, girls, total_items; printf("Enter the number of pens: "); scanf("%d", &pens); printf("Enter the number of pencils: "); scanf("%d", &pencils); printf("Enter the number of girls: "); scanf("%d", &girls); total_items = pens + pencils; if (total_items == girls) { int items_per_girl = total_items / girls; printf("Each girl will receive %d pens and pencils.\n", items_per_girl); } else { printf("The total number of pens and pencils does not equal the number of girls.\n"); }
return 0; } IF YOU HAVE ANY QUERIES CONTACT mahalakshmisripathi3@gmail.com