0
Give the output of the following program ( Assuming that all required header files are included in the program )
Give the output of the following program ( Assuming that all required header files are included in the program ) #include<iostream.h> #include<stdio.h> #include<conio.h> void TRANSFER(char *s1,char *s2) { int n,j=0; for(int i=0;*(s1+i)!='\0';i++) { n=*(s1+i); if(n%2==0) *(s2+j++)=*(s1+i); } } void main() { char *p="ChaRlesBabBaGe",q[80]; TRANSFER(p,q); cout<<q<<endl;}
1 Antwort
+ 1
The TRANSFER function puts in s2 all of the characters from s1 that have an even ascii code. The output here is hRlBbB.
http://www.asciitable.com/
https://code.sololearn.com/cH8WY9qGnU3Q/#cpp