31 lines
612 B
C
31 lines
612 B
C
/* Name: Garrett Haldrup
|
|
<nameAge.c>
|
|
Problem: Takes in name and age then outputs name with age in 5 years.
|
|
Certification of Authenticity:
|
|
I certify that this assignment is entirely my own work.
|
|
*/
|
|
#include <stdio.h>
|
|
|
|
int main(void) {
|
|
printf("This program will take your name and age and see your age in 5 years\n");
|
|
//declare
|
|
char name[100];
|
|
int age;
|
|
|
|
//input
|
|
printf("Enter your name: ");
|
|
scanf("%s", name);
|
|
printf("Enter your age: ");
|
|
scanf("%d", &age);
|
|
|
|
//Calculate
|
|
age += 5;
|
|
|
|
//output and calculate
|
|
printf("Hi %s! In five years, you will be %d\n", name, age);
|
|
|
|
return 0;
|
|
}
|
|
|
|
|