≡ Menu

gnu linux

Linux Downloads For Server / Desktop / Laptop Users

I would like to switch to Linux. I want to try free and functional operating system. How do I download Linux ISO images to install on my Desktop / Laptop / Server? Where can I download Linux operating system for my desktop usage?
[click to continue…]

How do I find out what version of Linux distribution I'm using from the shell (bash) prompt?
[click to continue…]

If else statement in C Program

Q. Can you give me example for If else statement in C Program under Linux or TC?

A. C follows universal syntax for if..else. You can use any complier GNU Linux gcc or UNIX or old good TC.

if..else syntax

General if..else syntax is as follows:

if ( condition ) {
   expr_set1;
}
else  {
   expr_set2;
}

If given condition is TRUE, expr_set1 will get executed.
If given condition is FALSE (not TRUE), expr_set2 will get executed.

if..else example

Following example will find out large number from given input:

#include<stdio.h>
int main(){
        int x,y;
        printf("Enter value for x :");
        scanf("%d",&x);
        printf("Enter value for y :");
        scanf("%d",&y);
        if ( x > y ){
                printf("X is large number - %d\n",x);
        }
        else{
                printf("Y is large number - %d\n",y);
        }
        return 0;
}

Linux / UNIX: Determine File Type

How do I determine the file type under UNIX or Linux like operating systems?
[click to continue…]