A Simple Questionier Program



Write a program that asks a user to input his name, age, and marital status and displays the result.








/* A simple questioner program*/


#include<stdio.h>


#include<stdlib.h>

/*function main begins program execution */
int main(void)

{

/*Initialization phase */
    char name [100];

    char mari [50];

    char yes;

    int age;

/*Processing phase */
    printf("\tThis Program helps catalog all your personal data.\n\n \tPlease complete the following question\n" );

    printf("Whats your name:");

    scanf("%s", name);

    printf("How old are you:");

    scanf("%d", &age);

    printf("Are you Married:");

    scanf("%s", mari);

 /*Terminating phase */
    printf("Thanks for filling out the questionier:\n");

    printf("Your name is: %s\n", name);

    printf("You are: %d\n", age);

    printf("Marriage status: %s",mari);




        return 0;

}

Comments

Popular posts from this blog

Body Mass Index Calculator In C

Adding two Integers in Java Application

Calculating Product, sum, difference, and quotient of Five Integers