Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Information Model On All Programming Languages Using C Program. #457

Open
AdityaKadam08 opened this issue Dec 28, 2024 · 0 comments
Open

Comments

@AdityaKadam08
Copy link

#include <stdio.h>
#include <string.h>

// Function to display information about a coding language
void displayLanguageInfo(char language[]) {
if (strcmp(language, "Python") == 0) {
printf("\nLanguage: Python\n");
printf("Purpose: General-purpose, AI/ML\n");
printf("Advantages: Easy syntax, large libraries\n");
printf("Use Cases: Web development, AI, data science\n");
} else if (strcmp(language, "Java") == 0) {
printf("\nLanguage: Java\n");
printf("Purpose: Cross-platform applications\n");
printf("Advantages: Platform-independent, secure\n");
printf("Use Cases: Android apps, enterprise applications\n");
} else if (strcmp(language, "C++") == 0) {
printf("\nLanguage: C++\n");
printf("Purpose: System/software development\n");
printf("Advantages: Fast, memory control\n");
printf("Use Cases: Game engines, OS development\n");
} else if (strcmp(language, "JavaScript") == 0) {
printf("\nLanguage: JavaScript\n");
printf("Purpose: Web development\n");
printf("Advantages: Client-side, interactive features\n");
printf("Use Cases: Websites, web apps\n");
} else if (strcmp(language, "C") == 0) {
printf("\nLanguage: C\n");
printf("Purpose: System programming\n");
printf("Advantages: Efficient, hardware-level control\n");
printf("Use Cases: Embedded systems, OS development\n");
} else {
printf("\nInvalid choice or language not found!\n");
}
}

int main() {
int choice;

do {
    printf("\n--- Coding Language Information Program ---\n");
    printf("1. Python\n");
    printf("2. Java\n");
    printf("3. C++\n");
    printf("4. JavaScript\n");
    printf("5. C\n");
    printf("6. Exit\n");
    printf("Enter your choice (1-6): ");
    scanf("%d", &choice);

    switch (choice) {
        case 1:
            displayLanguageInfo("Python");
            break;
        case 2:
            displayLanguageInfo("Java");
            break;
        case 3:
            displayLanguageInfo("C++");
            break;
        case 4:
            displayLanguageInfo("JavaScript");
            break;
        case 5:
            displayLanguageInfo("C");
            break;
        case 6:
            printf("Exiting program. Goodbye!\n");
            break;
        default:
            printf("Invalid choice! Please try again.\n");
    }
} while (choice != 6);

return 0;

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant