Computer Science, asked by amritkumar79591, 11 months ago

write a program to print your name,class,rollno, marks and age. Name this file, mu profile

Answers

Answered by meghna182
1

Answer:

Java Program

import java.util.*;

class MyProfile

{

public void main()

{

Scanner sc=new Scanner(System.in);

System.out.println("Enter your name");

String n=sc.next();

System.out.println("Enter your class");

int c=sc.nextInt();

System.out.println("Enter your marks");

int m=sc.nextInt();

System.out.println("Enter your roll number");

int rn=sc.nextInt();

System.out.println("My profile"):

System.out.println("Name :"+n);

System.out.println("Class "+c);

System.out.println("Roll number "+rn);

System.out.println("Marks "+m);

}

}

---------------------------------------------------------------

Hope it helps !

____________________________________________________________________

Answered by amuthamcablevkl
0

Answer:

def insertRec():

   rollno = int(input('Enter roll number:'))

   name = input('Enter Name:')

   marks = int(input('Enter Marks'))

rec = {'Rollno':rollno,'Name':name,'Marks':marks

f = open('student.dat','ab')

   pickle.dump(rec,f)

   f.close()

Explanation:

Similar questions