Was C really the first language to be platform independent?
This question is not terribly well-formed, in my opinion. The only
possible answer is "no" though.
C is not itself "platform independent". Neither, on the other hand,
is C "platform dependent" in the way (say) assembly or machine code
is. It is possible to write C programs that are portable to every
C89 or C99 (or any other particular standard) system.
If yes what was the nature of other languages which were there before
C like fortran ,basic,cobol?
It was always possible to write Fortran and COBOL programs that
would do the same thing on any standard-conforming system, as well.
C's unique (at the time) nature was that it was possible to write
complex, highly-useful programs that, while not "100% portable",
were easy to port from one system to another, even if those systems
were remarkably different from each other. For instance, "BSD
networking" systems ran on machines as dissimilar as the VAX and
the Data General Eclipse[%], with some porting work. Doing the same
in Fortran or COBOL would have been much more difficult.
[% These systems are not as different as, say, a VAX and a Symbolics
Lisp machine, or a Burroughs A-series. Both the VAX and the Eclipse
had 8-bit bytes. The Eclipse, however, had 16-bit "word" pointers
as its native pointers, and the C compiler used these for "int *"
and the like, so that "char *" to "int *" conversions used shift
instructions.]
Similarly-portable systems were constructed with Fortran as an
underlying language, but using a "preprocessor" (Ratfor). We had
these available on a Univac 1100-series machine, and whenever I
had to use that machine, I would use the "ed" editor instead of
the one built into EXEC-8.