609 views
0 votes
0 votes
what does following code mean if j=0 and a and b are two character pointers to two strings:
while(a[j]&&b[j])

3 Answers

0 votes
0 votes
what does following code mean if j=0 and a and b are two character pointers to two strings:
while(a[j]&&b[j])

if j=0

while(a[0] && b[0])

it means the character at location a[0] ans b[0] would be check by its ASCII value if both of them are positiove so there will be while loop run throghout the condition is true.

0 votes
0 votes
It means that the loop is iterating over two arrays, that are supposed to have at least one, zero element each

While iterating over the arrays, as the control reaches on the point where both elements are 0,

Loop will exit

Related questions

1 votes
1 votes
2 answers
1
Nulu Madhu asked Dec 14, 2018
444 views
How many times does the while loop gets executed if the following function is called as $f(120,13)?$ f(m,n) { ans := 1 while (m - n >= 0) { ans := ans * 2 m := m - n ...
3 votes
3 votes
1 answer
2
Sourabh Kumar asked Jul 20, 2016
627 views
What is the output of the following program?#include<stdio.h void main() { int n=3, i=0; do { n=n++; i++; } while(i!=3); printf(“%d\n”, n); }
1 votes
1 votes
1 answer
3
thehobo03 asked Jun 4, 2015
4,974 views
Assuming n>2 A() { while(n>1) { n = n/2; } }