CMSC 104

Problems using the scanf statement


1.) Identify and correct the errors in each of the following statements ( Note: there may be more than one error per statement.)

a.) scanf("d", value);

b.) Scanf("%d", anInterger);

c.) scanf("%d%d", &number1, number2);


2.) Write a statement to accomplish each of the following:

a.) Read an integer from the keyboard and store the value entered in integer variable a .

b.) Read three integers from the keyboard and store them in variables x , y , and z .

c.) Read a decimal number from the keyboard and store the value entered in a floating point variable called: numb