Okay, some clarifications.
Devanagari is not a
language, but a way of writing, an
alphabet.
Sanskrit was written in the
Devanagari script, as is
Hindi,
Nepali and a few other languages. The
Urdu language is grammatically identical (ok, nearly) to
Hindi, but is written in the
Persian script (modified to include sounds not in
Persian but in
Hindi and
Urdu). Both languages are so similar grammatically and in vocabulary that together they are called
Hindustani. My family (
Hindi-speaking) regularly watches
Pakistani TV in
Urdu and no one needs translation. It sounds different, but it makes sense.
The real reason they are considered different languages, in my opinion, is political.
Hindi comes from Sanskrit, sort of. Actually it comes from "vulgar Sanskrit" like the Romance languages come from vulgar Latin.
The difference between Hindi and Urdu is mostly lexical. Hindi, especially in the coinage of new words, looks to Sanskrit (and English of course). Urdu, besides English, looks to Persian and lately Arabic.