Finished first group of assignments
This commit is contained in:
18
programs/lst22/main.c
Normal file
18
programs/lst22/main.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int n;
|
||||
|
||||
printf("Integer n: ");
|
||||
scanf("%d", &n);
|
||||
|
||||
// Don't trust user input
|
||||
if (n < 10) {
|
||||
printf("Integer n must be more than 2 digits.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("Tens digit of interger n is %d.", n / 10 % 10);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user