Here is my code :
Code:
//Program in C
/* Revising methods strch()
* and strcmp() with stricmp(). */
#include <stdio.h>
#include <conio.h>
#include <string.h>
main() {
clrscr();
char ip_string[30];
char *ptr;
//Prompting user randomly, taking greet string
printf("Hey Hello! Greet me somehow. ");
fgets(ip_string, 20, stdin);
//Showing their entered string
printf("This is your input >%s<\n", ip_string);
/* Now trimming their input for
* any '\n' if exist
*/
if ((ptr = strchr(ip_string, '\n'))) {
*ptr = NULL;
}
//Now putting formatted output
printf("New output is >%s<\n", ip_string);
//Playing with user
char f_name[25];
printf("User enter your full name please: ");
fgets(f_name, 25, stdin);
int age;
printf("What's your age by the way? ");
scanf("%d", age);
printf("Now I know you better. You are %s ,and your age is %d", f_name, age);
getch();
return(0);
}
And output screen: