This question already has an answer here:
I am an Indian national. I am flying from New Delhi to Toronto with United Airlines via Newark. I will be landing at terminal C Newark Liberty airport with a transit time of 3 hours 55 minutes and then I have a connecting flight to Toronto from Terminal B La Guardia New York with the same United Airlines. Do I need a transit visa for the USA? More related information would be highly appreciated.