input: 1 2 3 4 5 output: 5 4 1 2 3 or 1 2 3 5 4
Can any one tell?
In these type of Question Its better to write recursive code use some counter. You can count how many node you want to reversr.
You can see this as an example.
Code written by VIKAS UPADHYAY
I will post the code here Soon.
Given a 2d array, u need to sort the 2 diagonals independently. And the elements in diagonal should remain in diagonal only.
INPUT => 24 2 3 4 7
6 13 8 5 10
11 12 9 14 15
16 21 18 25 20
17 22 23 24 1
OUTPUT => 1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25
#include<stdio.h> main() { int a=10; printf("%d\n",a++==a); }
Output should be 1 but it is coming as 0, Can anyone please explain?