Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

help with my challenge from dad

i'm making a program that will ask for a password and when you type someone's name it'll show their date of birth

this is the code i have written so far

#include<stdio.h>
#include<conio.h>
#include<string.h>
int main()
{
     char pwrd[]="abc123";
     char temp1[25] , temp2[25] , uname[]="xyz123" , ch;
     int i=0;
     //clrscr();
     printf("Enter the username: ");
     gets(temp1);
     printf("Enter the password:");
     while(1)
     {
   ch=getch();                                                           // 1
   if(ch==13)                                                            //  2
          break;
   printf("");                                                              // 3
   temp2[i++]=ch;                                                       //4
     }
     temp2[i]='\0';                                                               //5
     if(!strcmp(uname,temp1)&&!strcmp(temp2,pwrd))       //6
    printf("\nwrong password");
     else
    printf("\n\n");

char name;
printf("type someone's name?");
scanf("s%", &name);
printf("9 april 2004", name);

char name2;
printf("type someone's name?");
scanf("s%", &name2);
printf("17 march 2006", name2);


}