Arrays in C programming

An array is a group (or collection) of same data types. For example an int array holds the elements of int types while a float array holds the elements of float types. How to declare Array in C int num[35];  /* An integer array of 35 elements */ char ch[10];  /* An array of characters … Read more

goto statement in c programming

The goto statement is rarely used because it makes program confusing, less readable and complex. Also, when this is used, the control of the program won’t be easy to trace, hence it makes testing and debugging difficult. goto statement When a goto statement is encountered in a C program, the control jumps directly to the … Read more

switch case statement in C Programming

The switch case statement is used when we have multiple options and we need to perform a different task for each option. Switch Case Statement Before we see how a switch case statement works in a C program, let’s checkout the syntax of it. switch (variable or an integer expression) { case constant: //C Statements … Read more

continue statement

The continue statement is used inside loops. When a continue statement is encountered inside a loop, control jumps to the beginning of the loop for next iteration, skipping the execution of statements inside the body of loop for the current iteration. Continue statement Syntax: continue; Flow diagram of continue statement  

C – while loop in C programming

A loop is used for executing a block of statements repeatedly until a given condition returns false. In the previous tutorial we learned for loop. In this post we will learn while loop in C. while loop Syntax of while loop: while (condition test) { //Statements to be executed repeatedly // Increment (++) or Decrement … Read more

C – for loop in C programming

A loop is used for executing a block of statements repeatedly until a given condition returns false. C For loop This is one of the most frequently used loop in C programming. Syntax of for loop: for (initialization; condition test; increment or decrement) { //Statements to be executed repeatedly } Flow Diagram of For loop … Read more

Shell Script Example – Linux

linux

Shell Script Example – Linux for ((j=12;j<=31;j++)); do echo $j year=2020 month=01 day=$j mkdir /mnt/recording/final/11/$year-$month-$day results=($(mysql –user name -ppassword -h 192.168.2.4 db -Bse “SELECT id FROM calldetails  WHERE calldate BETWEEN ‘$year-$month-$day 00:00:00’ AND ‘$year-$month-$day 23:00:00′”)) cnt=${#results[@]} for (( i=0 ; i<cnt ; i++ )) do a=${results[$i]} echo auid=$a; cp /home/data/$year-$month-$day/$a.gsm /mnt/recording/final/11/$year-$month-$day/$a.gsm done done