Posts

Algorithms

Definition: - Algorithm is a stepwise solution to any problem which is used in programming to create a knowledge of steps to write a program. A sequential solution of any program that written in human language, called algorithm. Algorithm is first step of the solution process, after the analysis of problem, programmer write the algorithm of that problem. As Algorithm goes in sequence it is written in steps for example: - Write a algorithm to find out number is odd or even? Ans.  step 1 : start This Represents Starting of Algorithm. step 2 : input number This is for input which is inserted by user or given in program by default. step 3 : rem=number mod 2 rem is defined as variable which is storing the Result of number mod 2 step 4 : if rem=0 then                print "number even"            else     ...

Structure of Simple C Program

A simple C Program: Below C program is a very simple and basic program in C programming language. This C program displays “Hello World!” in the output window. And, all syntax and commands in C programming are case sensitive. Also, each statement should be ended with semicolon (;) which is a statement terminator.   1 2 3 4 5 6 7 8 #include <stdio.h> int main ( ) {    /* Our first simple C basic program */    printf ( "Hello World! " ) ;    getch ( ) ;    return 0 ; } Output: Hello World! C Basic commands Explanation #include <stdio.h> This is a preprocessor command that includes standard input output header file(stdio.h) from the C library before compiling a C program int main() This is the main function from where execution of any C program begins. { This indicates the beginning of the main function. /* _ some _ comments _ */ whatever is given inside the comman...