xyrena 0 Newbie Poster

hello, I am trying to learn c++, and I am trying to run this program to display the correct answers in the end. the user will be asked to input their answers to the 20 questions on the list.
for what I have read, I think I should be using some if or nested if statements? please help, thank you. Also, this is not my assignment (as I was accused of from other forum I tried), I am already working and just trying to learn programming on my spare time. thanks again, code is below.

#include <stdio.h>
#include <conio.h>
#define p printf
#define s scanf
main (){
int Ttl;
char Ln,Mi,Fn,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15,A16,A17,A18,A19,A20;
clrscr();

p("\n
p("\n\nEnter your Last name : ");
s("%s",&Ln);
p("\nEnter your Middle Initial : ");
s("%s",&Mi);
p("\nEnter your First name : ");
s("%s",&Fn);
p("\nType the corresponding letter to each question.");
p("\n1.) Shortcut for'New Line'");
p("\n  A. Ctrl + R        C. Ctrl + M ");
p("\n  B. Ctrl + QC       D. Ctrl + KC ");
p("\nAnswer : ");
s("%s",A1);

p("\n2.) Shortcut for'Up Arrow Key'");
p("\n  A. Ctrl + Z        C. Ctrl + X ");
p("\n  B. Ctrl + QC       D. Ctrl + E ");
p("\nAnswer : ");
s("%s",A2);

p("\n3.) Shortcut for'Down Arrow Key'");
p("\n  A. Ctrl + X        C. Ctrl + E ");
p("\n  B. Ctrl + C        D. Ctrl + R ");
p("\nAnswer : ");
s("%s",A3);

p("\n4.) Shortcut for'Scroll Down'");
p("\n  A. Ctrl + X        C. Ctrl + R ");
p("\n  B. Ctrl + E        D. Ctrl + Z ");
p("\nAnswer : ");
s("%s",A4);

p("\n5.) Shortcut for'Page Up'");
p("\n  A. Ctrl + K        C. Ctrl + R ");
p("\n  B. Ctrl + Q        D. Ctrl + C ");
p("\nAnswer : ");
s("%s",A5);

p("\n6.) Shortcut for'Page Down'");
p("\n  A. Ctrl + Q        C. Ctrl + K ");
p("\n  B. Ctrl + C        D. Ctrl + Z ");
p("\nAnswer : ");
s("%s",A6);

p("\n7.) Shortcut for'Top of a File'");
p("\n  A. Ctrl + KY       C. Ctrl + KC  ");
p("\n  B. Ctrl + QC       D. Ctrl + QR ");
p("\nAnswer : ");
s("%s",A7);

p("\n8.) Shortcut for'Bottom of a File'");
p("\n  A. Ctrl + QC       C. Ctrl + KY ");
p("\n  B. Ctrl + QS       D. Ctrl + KC ");
p("\nAnswer : ");
s("%s",A8);

p("\n9.) Shortcut for'Copy Block'");
p("\n  A. Ctrl + QY       C. Ctrl + KC ");
p("\n  B. Ctrl + KY       D. Ctrl + QC ");
p("\nAnswer : ");
s("%s",A9);

p("\n10.) Shortcut for'Delete Block'");
p("\n  A. Ctrl + QR       C. Ctrl + QC ");
p("\n  B. Ctrl + KC       D. Ctrl + KY ");
p("\nAnswer : ");
s("%s",A10);

p("\n11.) Hot Keys Command 'Saves the file currently being edited'");
p("\n  A. F6          C. F2 ");
p("\n  B. F4          D. F9 ");
p("\nAnswer : ");
s("%s",A11);

p("\n12.) Hot Keys Command'Loads a File'");
p("\n  A. F7          C. F1");
p("\n  B. F3          D. F8");
p("\nAnswer : ");
s("%s",A12);

p("\n13.) Hot Keys Command'Compiles and link the program'");
p("\n  A. F4          C. F3 ");
p("\n  B. F2          D. F9 ");
p("\nAnswer : ");
s("%s",A13);

p("\n14.) Hot Keys Command'Compiles file to .obj file'");
p("\n  A. Alt + F9        C. Alt + F5 ");
p("\n  B. Alt + F2        D. Alt + F7 ");
p("\nAnswer : ");
s("%s",A14);

p("\n15.) Hot Keys Command'Next error'");
p("\n  A. Alt + F4        C. Alt + F9 ");
p("\n  B. Alt + F7        D. Alt + F8 ");
p("\nAnswer : ");
s("%s",A15);

p("\n16.) Hot Keys Command'Previous error'");
p("\n  A. Alt + F7        C. Alt + F9 ");
p("\n  B. Alt + F3        D. Alt + F1 ");
p("\nAnswer : ");
s("%s",A16);

p("\n17.) Hot Keys Command'Activates the file menu'");
p("\n  A. Alt + E         C. Alt + C ");
p("\n  B. Alt + F         D. Alt + O ");
p("\nAnswer : ");
s("%s",A17);

p("\n18.) Hot Keys Command'Quit the turbo c program'");
p("\n  A. Alt + D         C. Alt + P ");
p("\n  B. Alt + C         D. Alt + X ");
p("\nAnswer : ");
s("%s",A18);

p("\n19.) Hot Keys Command'Runs the program'");
p("\n  A. Ctrl + F3       C. Ctrl + F2 ");
p("\n  B. Ctrl + F5       D. Ctrl + F9 ");
p("\nAnswer : ");
s("%s",A19);

p("\n20.) Hot Keys Command'Switches between windows'");
p("\n  A. F2          C. F6 ");
p("\n  B. F4          D. F8 ");
p("\nAnswer : ");
s("%s",A20);
p("Thankyou for answering the following question");
p("\nCalculating correct answers. Please wait .......");
delay(5000);
p("\nYout total correct answer is : ");
p("\n\t\tEnd of the Program");

getche();
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.