#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 20
int main()
{
system("color f0");
printf("Enter your name: ");
char *name = malloc(sizeof(char));
fflush(stdin); // free the buffer
gets(name);
printf("Your age: ");
int age;
scanf("%d", &age);
puts("");
printf("Your data:\n");
printf("Name: %s\n", name);
printf("Age : %d\n", age);
puts("");
#include <stdlib.h>
#include <string.h>
#define N 20
int main()
{
system("color f0");
printf("Enter your name: ");
char *name = malloc(sizeof(char));
fflush(stdin); // free the buffer
gets(name);
printf("Your age: ");
int age;
scanf("%d", &age);
puts("");
printf("Your data:\n");
printf("Name: %s\n", name);
printf("Age : %d\n", age);
puts("");
system("pause");
return 0;
}
No comments:
Post a Comment