I learnt that C language is platform dependent ,so the code which behaves correctly for one OS, will not work for other OS.(1)Am I write?(2)What features of a software language depend on the OS?
Not certain; I was hoping somebody else would give you an answer. The C code tends to be the same on different platforms, but the compiler is very different because different platforms (and even more so, different types of chip) require different binary code. There are lots of differences between OSs, but these are a few of the best-known.
Line end: \n on *nix and newer Macs, \r on old Macs (very unusual nowadays) and \r\n on DOS/Windows
File separators: \ on DOS/Windows and / on Mac and *nix.
Path Separators: ; on DOS/Windows and : on Mac/*nix.
End-of-file: ctrl-D (and maybe something else) on *nix/Mac, ctrl-Z on DOS/Windows.
There are lots of other minor differences. Many applications can compensate for different line ends, etc., but not all.
When you compile C or C++ code, you usually compile it directly to native machine code and link it with libraries that are specific to the operating system. So if you compile your C program on Windows, you will get an *.exe file with Intel x86 machine instructions in it, and containing calls to Windows operating system functions. You cannot run that program on a different operating system or on a system which doesn't have an Intel x86 CPU.
Contrast that to Java: you compile Java to bytecode, which runs on the JVM. The bytecode can run on any computer or other device where there is a JVM, it doesn't matter what kind of CPU the device has. Also, all the classes and interfaces in the standard Java library are guaranteed to be available.
Note that in principle you could compile C or C++ to bytecode too. There's nothing inherent in the programming languages that makes them necessarily platform-dependent. It's just how C and C++ are commonly used. C and C++ have a number of features that make them efficient languages, but also harder to make programs that compile on different machines and operating systems. For example, the size of an int in C and C++ depends on your compiler and target CPU and operating system. On some systems, an int is 32 bits, on other systems it's 64 bits and on other systems it might be only 16 bits. (In Java, an int is always 32 bits, no matter what CPU the program is going to be running on).