Hi
This my first c programme.It asks 5 objective questions and displays the result at the end.
But when i compile it and run, it asks only for variables A,C and E .It doesn't ask for the inputs to question no. 2 and 4.It only displays these questions and skip the input part.
Please let me know what's the problem with it.
/*OBJ Ques*/
#include<stdio.h>
main()
{
char A,B,C,D,E ;
int AA,BB,CC,DD,EE,res;
printf("\n1.Who amongst the following is the Head of the RBI at present ?\na.Mr.
M.V.Kamath\nb.Mr. Y.V.Reddy\nc.Mr. N.R.Narayanmurthy\nd.Mr.O.P.Bhatt");
scanf("%c",&A);
printf("\n2. Mjority of rural people still prefer to go to which of the following for their
credit needs ?\na.Money lenders\nb.Foreign Bankers\nc.NABARD\nd.RBI");
scanf("%c",&B);
printf("\n3. India has different categories of commercial banks.Which of the following is
NOT one such categories ?\na.Private Banks\nb.Commodities Banks\nc.Nationalized
Banks\nd.Cooperative Banks");
scanf("%c",&C);
printf("\n4.Which of the following countries does not play International
Cricket?\na.Russia\nb.England\nc.SouthAfrica\nd.Pakistan");
scanf("%c",&D);
printf("\n5.Which is the world’s first credit card?\na.American
Express\nb.Visa\nc.Mastercard\nd.Diners Club Card");
scanf("%c",&E);
if(A=='b') AA=1; else AA=0;
if(B=='b') BB=1; else BB=0;
if(C=='b') CC=1; else CC=0;
if(D=='b') DD=1; else DD=0;
if(E=='b') EE=1; else EE=0;
res=AA+BB+CC+DD+EE ;
printf("\nYour score=%d",res);
}