Skip to main content

Posts

C Interview Questions–to be solved

These programs were asked in various colleges/universities across India. These Questions were in my email dated 1999. So please let me know if any copyright information, so that I will remove it. But these questions are very much helpful for budding Student (engineers and interviewees). //  Carefully study the given program #include <stdio.h> #include <alloc.h> void main(void); typedef struct NType {     int i;     char c;     long x; }NewType; void main(void) {     NewType *c;     c=(NewType*)malloc(sizeof(NewType));     c->i=100;     c->c='C';     (*c).x=100l;     printf("%d,%c,%4ld",c->i,c->c,c->x); } /* What is the output of this program ? a)  It will produce a variable redefinition error b)  It w...

C programs–For practice (to be solved)

#include <stdio.h> #define A     2 #define B     3 #define C     A - B #define D    4 - C main() {     int x = D;         printf("x = %d\n", x); } ------------------- #include <stdio.h> main() {     int i =3;     printf("%d\n", i++);     printf("%d\n", i++); } --------------- #include <stdio.h> #define A      RAM #define RAM     ram main() {     char *ram = "hello ram!";     printf("%s\n", A); } ------------- #include <stdio.h> main() {     int i = 5, sum = 0;         do {         sum += 1/i;        } whil...

Fedora 12 Installation

This post will show you the installation of Fedora along with Windows 7. This Post is mainly for Beginners of Linux those who entered the college just now who don’t have prior working knowledge on Linux Here we go…. I have taken DVD Version of Fedora 12 (32 Bit OS) Step 1: Create a Partition on windows to give space for Fedora, Just 20GB space is enough.. You can store all your files under windows and use it in linux whenever you need. So no extra space needed for Linux. (see the image below) Step 2:  Insert the DVD and boot from the DVD and select the first option (as shown below) “ Install or Upgrade an existing System” Once selected, the system asks you to check the correctness of the media (DVD ROM). if you have doubt with your DVD, please click OK else SKIP it. (see below) Once done, start proceeding with the installation as given in the following images Step 4: Select the language (as given below, If you have doubt, leave with the default and click next) Step 5: S...

Linux for NS2 (Network Simulator 2)

At many places, I happen to see researchers and students wanted to use Windows for NS2 rather than Linux. The reason may be, Linux is tough It occupies more space and more memory in my Computer Linux uses lot of commands and i am not aware of it Tough to handle dual boot OS (windows and Linux) always wanted to be in the cakewalk. (never try a new thing) etc But here are some basic tips for using NS2 under a Linux Machine. It is enough to know some basic Linux commands to work with NS2 (hardly not more than 20 commands) One should have a basic knowledge of how tree structure in Linux/Unix look like Finally, where to set the PATH information in Linux With all the above three, one can confidentally work on Linux. As for as windows is concerned, upto NS2.27 version is tested under windows and recent versions there is no hope (however it will work fine, but "Use at your Own Risk") Please see this post to install Fedora 12 in your Computer Now we will see some...

Tracegraph installation in Windows 7

How to install tracegraph in windows . here are the steps Download it from here Step 1: Unzip the tracegraph202.tar file to C: or D:  (in my case I extracted to D:/tracegraph202) Step 2: copy the path (DLL files) to the environmental variables (in my case the path is D:\tracegraph202\bin\win32 ) Step 3: that’s it run the trgraph.exe file which is available under the tracegraph202/ folder.