fork download
  1. #include <stdio.h>
  2.  
  3. struct student{
  4. int rollno;
  5. char full_name[20];
  6. char address[50];
  7. char birthmark[50];
  8. };
  9.  
  10.  
  11. int main(void){
  12. struct student var;
  13.  
  14. printf("rollno : "); scanf("%d", &var.rollno);scanf("%*[^\n]");scanf("%*c");
  15. printf("name : "); scanf("%19[^\n]%*c", var.full_name);
  16. printf("address : "); scanf("%49[^\n]%*c", var.address);
  17. printf("birthmark : ");scanf("%49[^\n]%*c", var.birthmark);
  18.  
  19. printf("\n%d,'%s','%s','%s'\n", var.rollno, var.full_name, var.address, var.birthmark);
  20. return 0;
  21. }
Success #stdin #stdout 0s 2164KB
stdin
6
john snow
winterfell of north
swords wound all over
stdout
rollno : name : address : birthmark : 
6,'john snow','winterfell of north','swords wound all over'