C Language

June 10, 2023

How to use function with no arguments and no return values in C Language

Program to use function with arguments and no return values in C Language


#include <stdio.h>
void displaymenu(void);
int main()
{
    int choice;
    displaymenu();
    printf("Enter your choice");
    scanf("%d", &choice);
    return 0;
}
void displaymenu(void)
{
    printf("1.Create database\n");
    printf("2.Insert new record\n");
    printf("3.Modify a record\n");
    printf("4.Delete a record\n");
    printf("5.Display all records\n");
    printf("6.Exit\n");
}

Output


1.Create database
2.Insert new record
3.Modify a record
4.Delete a record
5.Display all records
6.Exit
Enter your choice

Tags:

by : Nadeem Khan

Quick Summary:

Program to use function with arguments and no return values in C Language copy #include <stdio.h> void displaymenu(void); int main() { int choice; displaymenu(); printf(“Enter your choice”); scanf(“%d”, &choice); return 0; } void displaymenu(void) { printf(“1.Create database\n”); printf(“2.Insert new record\n”); printf(“3.Modify a record\n”); printf(“4.Delete a record\n”); printf(“5.Display all records\n”); printf(“6.Exit\n”); } Output 1.Create database 2.Insert […]