Advertisement
atoivan

Untitled

Feb 9th, 2012
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.76 KB | None | 0 0
  1. why is the for loop not working
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5.  
  6. main()
  7. {
  8.     int num=2;
  9.     char name;
  10.     int age=0;
  11.     char sex; char pass; char uname; char ans='y';
  12.     int count=1;
  13.  
  14.     printf("Enter your name \n");
  15.     scanf("%s", &name);
  16.     puts("Enter your Age \n");
  17.     scanf("%d", &age);
  18.     puts("Enter your gender \n");
  19.     scanf("%s", &sex);
  20.     puts("Enter your password \n");
  21.     scanf("%s", &pass);
  22.     puts("Enter your Username \n");
  23.     scanf("%s", &uname);
  24.  
  25. for(;;)
  26. {
  27. puts("Do u want to view your profile (Y or N):");
  28. scanf("%c",&ans);
  29.  
  30. if(ans == 'y')
  31. continue;
  32. else
  33. break;
  34. }           /* look for any sign of no */
  35. puts("Enter your Username");
  36. scanf("%s", &uname);
  37. //if(uname==uname)
  38. //printf("Enter your password");
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement