Roll Number and Marks Search

Given an array of roll number and marks the task is to take a roll number from user and search for it in the existing array. If found print the marks against that roll number else display an appropriate error message.

Java
import java.util.*;
public class RollMarksSearch
{
    public static void main(String args[])
    {
        int size=0,sR=0,flag=0;
        Scanner sc=new Scanner(System.in);
        System.out.print("Enter number of students: ");
        size=sc.nextInt();
        int roll[]=new int[size];
        double marks[]=new double[size];
        System.out.println("Enter Roll and Marks of the students:-");
        for(int i=0;i<size;i++)
        {
            roll[i]=sc.nextInt();
            marks[i]=sc.nextDouble();
            System.out.println();
        }
        System.out.print("Enter a roll number to search for: ");
        sR=sc.nextInt();
        for(int i=0;i<size;i++)
        {
            if(sR==roll[i])
            {
                System.out.println("Roll Number found!");
                System.out.println("Marks obtained: "+marks[i]);
                flag=1;
            }
        }
        if(flag==0)
        {
            System.out.println("Roll Number not found");
        }
    }
}
Java