+ ***d; cout<<”\n”<<**c (***d)+= 10; a + cout<<”\n”<< *b; } Ans: 60 , 120 140 160 Q5. Give the output of the following program: #include <iostream.h> #include <string.h> #include <ctype.h> void funnystr(char *s, int n = 2) { int i = n; while(i < strlen(s)) { s[i] = '-'; } i = i + n; i = 0; while(s[i] != '\0') { if(s[i] > 'A' && s[i] < 'P') s[i] = tolower(s[i]); else if(s[i] > 'a' && s[i] < 'p') { if(i % 3 == 0) s[i] = tolower(s[i-1]); else } } } s[i] = tolower(s[i]); void main() { char str[] = "MiCroSoFT"; funnystr(str,3); cout<<str; }
cout<<”\n”<<**c + ***d; (***d)+= 10; cout<<”\n”<< a + *b; } Ans: 60 , 120 140 160 Q5. Give the output of the following program: #include <iostream.h> #include <string.h> #include <ctype.h> void funnystr(char *s, int n = 2) { int i = n; while(i < strlen(s)) { } i = 0; s[i] = '-'; i = i + n; while(s[i] != '\0') { if(s[i] > 'A' && s[i] < 'P') s[i] = tolower(s[i]); else if(s[i] > 'a' && s[i] < 'p') { if(i % 3 == 0) s[i] = tolower(s[i-1]); } } } else s[i] = tolower(s[i]); void main() { char str[] = "MiCroSoFT"; funnystr(str,3); cout<<str; }
585790054compt_sci.docx