1,139 views
0 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 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 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
Position:
Show:

Related questions

1 1 vote
2 answers 2 answers
989
989 views
Nulu Madhu asked Dec 14, 2018
989 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 3 votes
1 1 answer
1.0k
1.0k views
Sourabh Kumar asked Jul 20, 2016
1,018 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 1 vote
1 answers 1 answer
5.4k
5.4k views
thehobo03 asked Jun 4, 2015
5,355 views
Assuming n>2 A() { while(n>1) { n = n/2; } }
1 1 vote
2 answers 2 answers
985
985 views
gopal_gate asked Jul 29, 2023
985 views
In the picture below:Can anyone explain to me why ‘while’ loop starting from 2 but in the case of ‘for’ loop it is starting from 1 (although i++ is available for both in ...