Write a C++ program that reads an array of N `Student` structures and sorts them in descending order based on their marks using `std::sort`.
Number of students N, followed by N records (Roll, Name, Marks).
Print sorted student names and marks row by row.
1 <= N <= 50
3 101 John 85.5 102 Alice 96.0 103 Bob 90.0
Alice: 96.00 Bob: 90.00 John: 85.50
Demonstrates custom comparator lambdas with `std::sort` for structure fields.
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
struct Student {
int roll;
std::string name;
float marks;
};
int main() {
int n;
if (std::cin >> n) {
std::vector<Student> students(n);
for (int i = 0; i < n; i++) {
std::cin >> students[i].roll >> students[i].name >> students[i].marks;
}
// Write your code here to sort and print students
}
return 0;
}Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used