Input/Output with scanf()/printf()

Example:

char name[20] = "Bob";
int age = 21;
printf( "Hello %s, you are %d years old\n", name, age );
OUTPUT: Hello Bob, you are 21 years old

I'm trying to make a program that scans for text, and based on the text, it prints a different message. Here is the code I have so far.

Example:

<code>
#include <stdio.h>
#include <conio.h>
void main()
{
char test[4];
printf("\n\n");
scanf("%s",test);
printf("%s\n\n",test);
if(test == test)
{
printf("test2");
}
else
{
printf("test3");
}
}
</code>

Back