Saved Bookmarks
| 1. |
Find the output of the following :#include<iostream.h>void switchover(int A[ ],int N, int split){for(int K = 0; K<N; K++)if(K<split)A[K] += K;elseA[K]*= K; }void display(int A[ ] ,int N){for(int K = 0; K<N; K++)(K%2== 0) ?cout<<A[K]<<"%" : cout<<A[K]<<endl;}void main( ){ int H[ ] = {30,40,50,20,10,5};switchover(H,6,3);display(H,6);} |
|
Answer» The output is: 30%41 52%60 40%25 |
|