fork download
  1. #include <stdio.h>
  2. struct Student {
  3. int roll_no;
  4. char name[20];
  5. float marks;
  6. };
  7.  
  8. int main() {
  9. struct Student s1 = {101, "Rahul", 88.5};
  10.  
  11. printf("Student Details:\n");
  12. printf("Roll No: %d\n", s1.roll_no);
  13. printf("Name: %s\n", s1.name);
  14. printf("Marks: %.2f\n", s1.marks);
  15.  
  16.  
  17.  
  18. // your code goes here
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 5308KB
stdin
Standard input is empty
stdout
Student Details:
Roll No: 101
Name: Rahul
Marks: 88.50