In: Computer Science
REWRITE FOLLOWING CODES USING DO...WHILE LOOP. BY USING C LANGUAGE
#include <stdio.h>
int main(void) {
int count =2;
// COUNT TAKEN 2 AS TO PRINT 2 TIMES
while(count--){
printf("\--------------------------------------------\ \n");
printf("\ BBBBB A \ \n");
printf("\ B B A A \ \n");
printf("\ BBBB A A \ \n");
printf("\ B B AAAAAAA \ \n");
printf("\ BBBBB A A \ \n");
printf("\---------------------------------------------\ \n");
}
return 0;
}
`Hey,
Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
Brother below is the code in which do while loop is used instead of normal while. Brother the spaces might be changed/ So, I request you to go through below link where I have saved the code.
https://onlinegdb.com/B1gDBXWSLB
#include <stdio.h>
int main(void) {
int count =2;
// COUNT TAKEN 2 AS TO PRINT 2 TIMES
do{
printf("\--------------------------------------------\ \n");
printf("\ BBBBB A \ \n");
printf("\ B B A A \ \n");
printf("\ BBBB A A \ \n");
printf("\ B B AAAAAAA \ \n");
printf("\ BBBBB A A \ \n");
printf("\---------------------------------------------\
\n");
count--;
}while(count>=1);
return 0;
}
Kindly revert for any queries
Thanks.