Hello Aarish,
No it is not a compulsion to have cs in class 12 for doing b.tech in cs branch.
You can opt for any branch based on your marks in the exam.
It only helps you to understand the concepts more easily if you have same subject as 12 in your b.tech.
Hope your question is answered.
Feel free to ask more.
Regular exam updates, QnA, Predictors, College Applications & E-books now on your Mobile