0% found this document useful (0 votes)
20 views

Lab Exercise 1

The document discusses a lab exercise involving assemblers, input/output units, assembly languages, and translators. It includes multiple choice questions with answers and code snippets using printf statements, with errors and corrections provided.

Uploaded by

Michael Shemal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Lab Exercise 1

The document discusses a lab exercise involving assemblers, input/output units, assembly languages, and translators. It includes multiple choice questions with answers and code snippets using printf statements, with errors and corrections provided.

Uploaded by

Michael Shemal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Lab Exercise 1

Name: Michael Shemal


(1).

a) Assembler
b) Input unit
c) Programming
d) Assembly language
e) Output unit
f) Translator

(2). b

(3). g

(4). k

(5). n

(6). a

(7).
*
**
***
****
*****

1|Page
(8).

a)
#include <stdio.h>
int main()
{
printf("1,2,3,4");

return 0;
}
b)
#include <stdio.h>
int main()
{
printf("%d %d %d %d", 1, 2, 3, 4);

return 0;
}
c)
#include <stdio.h>
int main()
{
printf("%d ", 1);
printf("%d ", 2);
printf("%d ", 3);
printf("%d ", 4);
return 0;

2|Page
}
(9).
a) The line break should be inside the double quotations,
Correction: printf(“The product of %d and %d is %d\n”, x, y);
b) Sides must be changed
Correction: sumOfNumbers = firstNumber + secondNumber
c) One conversion Specifier is missing
Correction: printf(“Remainder of %d divided by %d is %d\n”, x, y, x % y);
d) The first double quotation is missing
Correction: printf(“%d is equal to %d\n”, x, y);
e) The ‘,’ after the line break should be out of the double quotations
Correction: printf(“The sum is %d\n”, x + y);
f) The second quotation is missing and you should not have ‘&’ in the printf
Correction: printf(“The value you entered is %d\n”, value);

3|Page

You might also like