What is the output of this program? [code] #! /usr/bin/awk -f BEGIN { print log(1) }[/code]

Hằng Đoàn

New member
What is the output of this program?
Code:
   #! /usr/bin/awk -f
   BEGIN {
       print log(1)
   }
A. 0
B. syntax error
C. fatal error
D. segmentation fault
 
Answer: a
Explanation: The function log() is built-in function and need not to be defined. This function calculates the natural logarithm of positive numbers.
Output:
root@ubuntu:/home/123hoidap# ./test.awk
0
root@ubuntu:/home/123hoidap#
 

Tìm kiếm

Back
Top