is this what we should start with?
I got the idea from a source in the projects part of website so thought id try it on my own.
Code:
#include <stdio.h>
#include <string.h>
int main()
{
int age;
char name[3];
printf( "Enter name of animal: " );
scanf( "%s", name );
if ( strcmp( name, "dog" ) == 0) {
printf( "ok, its a dog\n");
printf( "enter age: " );
scanf( "%d", &age );
age *= 7;
printf( "your dog is %d in doggy years heh\n", age ); }
else if (strcmp(name, "cat" ) == 0) {
printf ( "ok its a cat\n" );
printf ( "enter age: " );
scanf( "%d", &age );
age *= 7;
printf( "your cat is %d in cat years\n", age); }
getchar();
getchar();
return 0;
}
it works fine, is this the easiest way to right it or is there a different way?
but anyway, is this ok for my first tinyyyyyyy program?
reece.