Lab 6

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Click to edit Master title style

• Click to edit Master text styles


Computer Programming
• Second level
• Third level
• Fourth level
• Fifth level
Lab6

Nov 2, 2022
Exercise 1
Click to edit Master title style
• Write a program that prints the multiplication table satisfying
•theClick
following conditions.
to edit Master text styles
• A positive integer (from 1 to 20) is input.
• •If Second level
a value out of the range is input, re-input is requested, and it is
• Third
repeatedly level
performed until a specific key is input.
• It prints •the
Fourth level
multiplication table of the input integer from the 1st
multiplication• table
Fifthto
level
the screen.
• Up to 3 multiplication tables can be printed horizontally.
• The exit() function is used to end program execution and return to the
operating system. A return code of "0" exits the program without an
error message.
#include <stdlib.h>
int main( void )
{
// ...
exit(0);
}
2
Exercise 1
Click to edit
• Program output
Master title style
• Click to edit Master text styles
• Second level
• Third level
• Fourth level
• Fifth level

3
Exercise 1
Click to edit
• Program output
Master title style
• Click to edit Master text styles
• Second level
• Third level
• Fourth level
• Fifth level

4
Exercise 2
Click to edit Master title style
• Implement a function to determine prime numbers up to one positive
integer as input. Prime numbers are denoted by the # symbol.

•The
Click to edit Master text styles
function prototype is as follows:
• Second
void level n);
check_prime(int
• Third level
• Fourth level
• Fifth level

5
Exercise 2
Click to edit
• Program output
Master title style
• Click to edit Master text styles
• Second level
• Third level
• Fourth level
• Fifth level

6
Submission
Click to edit Master
• Submit to CSE server
title style
Lab # Class #
• Click to edit Master text styles
At the end of the Lab6, submit your C sources file by typing

• Second level
~gs1401/bin/submit Lab6_1 ex6_1.c ex6_2.c // class 1, Deadline: Friday by 10:50 am
• Third level
~gs1401/bin/submit Lab6_2 ex6_1.c ex6_2.c // class 2, Deadline: Friday by 11:50 am
• Fourth
~gs1401/bin/submit Lab6_3 ex6_1.c ex6_2.c // class 3, Deadline: Friday by 1:50 pm
level
• Fifthex6_1.c
~gs1401/bin/submit Lab6_4 level ex6_2.c // class 4, Deadline: Friday by 2:50 pm
~gs1401/bin/submit Lab6_5 ex6_1.c ex6_2.c // class 5, Deadline: Friday by 3:50 pm
~gs1401/bin/submit Lab6_6 ex6_1.c ex6_2.c // class 6, Deadline: Friday by 4:50 pm

You may check that you have submitted your source code correctly by typing
~gs1401/bin/submit -check

You might also like