What is the output of this program? [code] #! /usr/bin/awk -f BEGIN { one=10; two=3; print (one%two)+10

Bờm

Member
What is the output of this program?
Code:
    #! /usr/bin/awk -f
    BEGIN {
        one=10;
        two=3;
        print (one%two)+10 
    }
A. (one%two)+10
B. 13
C. 11
D. syntax error
 
Answer: c
Explanation: The remainder of 10/3 is 1. remainder is added to 10.
Output:
root@ubuntu:/home/123hoidap# chmod +x test.awk
root@ubuntu:/home/123hoidap# ./test.awk
11
root@ubuntu:/home/123hoidap#
 

Tìm kiếm

Back
Top