Code:main() { int a,b,c; char z; printf("Enter the 3 nos: \n"); scanf("%d",&a); scanf("%d",&b); scanf("%d",&c); printf("\n"); printf("Enter Greatest or Smallest"); scanf("%c",&z); //Program Quits On This Line!! if(z=='g') { if(a>b && a>c) { printf("%d is greatest",a); } else if(b>a && b>c) { printf("%d is greatest",b); } else { printf("%d is greatest",c); } } else if (z=='s') { if(a<b && a<c) { printf("%d is smallest",a); } else if(b<a && b<c) { printf("%d is smallest",b); } else { printf("%d is smallest",c); } } else { printf("Please Enter g for greatest and s for smallest!"); } getch(); /* It compiles perfectly but quits at the mentioned point! I have just started c programming so the problem may look stupid to many! Plz bear with me! :biggrin: */ }