What is the output of this program?
#! /usr/bin/awk -f
BEGIN {
a=6
do {
print "google"
a++
} while (a<5)
}
a) nothing will print
b) "google" will print 5 times
c) "google" will print 4 times
d) "google" will print only 1 time
Submitted by: Murtazad) "google" will print only 1 time
Explanation:
Even the condition is false of do-while loop, the body is executed once.
Output:
root@ubuntu:/home/google# ./test.awk
google
root@ubuntu:/home/google#
Submitted by: Murtaza
Explanation:
Even the condition is false of do-while loop, the body is executed once.
Output:
root@ubuntu:/home/google# ./test.awk
root@ubuntu:/home/google#
Submitted by: Murtaza
Read Online Awk Programming Job Interview Questions And Answers
Top Awk Programming Questions
☺ | The next statement: |
☺ | The command \"awk {print $1} san.txt\" will: |
☺ | The break statement: |
☺ | Which statement instructs gawk to stop processing the current data file? |
Top Linux OS Categories
☺ | Device Drivers Interview Questions. |
☺ | Linux OS Management Interview Questions. |
☺ | Linux Makefile Interview Questions. |
☺ | Linux Environment Interview Questions. |
☺ | Linux OS Shell Interview Questions. |