The Format of C

Statements are terminated with semicolons. Indentation is ignored by the compiler. C is case sensitive – all keywords and Standard. Library functions are lowercase. Strings are placed in double quotes. Newlines are handled via \n Programs are capable of flagging success or error, those forgetting to do so have one or other chosen randomly!  

Merits of C Programming

1. C is a general purpose programming language. You can generate games, business software, utilities, mathematical models, word processors, spreadsheets and other kinds of software. 2. C is a structured programming language. It uses structured statements such as while, for loops in place of goto statements which cause bugs (error) in the program. 3. System independence- … Read more

A Brief History of UNIX and C

The first UNIX implementation was developed in 1969 (the same year that Linus Torvalds was born) by Ken Thompson at Bell Laboratories, a division of the tele- phone corporation, AT&T. It was written in assembler for a Digital PDP-7 mini- computer. The name UNIX was a pun on MULTICS (Multiplexed Information and Computing Service), the … Read more

a program to read the data for the customer, calculate the interest and service charge, and print the customer’s name, average balance, interest, and service charge.

//calculate interest and service charge for bank customer #include <stdio.h> int main() { char customer[30], acctNum[30]; double avgBalance, interest, service; int numTrans; printf(“Name? “); gets(customer); printf(“Account number? “); gets(acctNum); printf(“Average balance? “); scanf(“%lf”, &avgBalance); printf(“Number of transactions? “); scanf(“%d”, &numTrans); interest = avgBalance * 0.06; service = numTrans * 0.50; printf(“\nName: %s\n”, customer); printf(“Average balance: … Read more

C program for matrix addition

matrix program in c

C program for matrix addition #include <stdio.h> int main() { int a, b, c, d; int m1[10][10], m2[10][10], sum[10][10]; printf(“Please enter the number of rows of matrix\n”); scanf(“%d”, &a); printf(“Please enter number of columns of matrix\n”); scanf(“%d”, &b); printf(“Please enter the elements of first matrix one by one\n”); for ( c = 0 ; c … Read more

C Program to perform addition and subtraction of Matrices

C Program to perform addition and subtraction of Matrices

C Program to perform addition and subtraction of Matrices #include<stdio.h> int main() { printf(“\n\n\t\Eduguru- C Program example\n\n\n”); int n, m, c, d, first[10][10], second[10][10], sum[10][10], diff[10][10]; printf(“\nEnter the number of rows and columns of the first matrix \n\n”); scanf(“%d%d”, &m, &n); printf(“\nEnter the %d elements of the first matrix \n\n”, m*n); for(c = 0; c … Read more

The Java Development Life Cycle

Moving back to the world of Java, we see that it is a high-level programming language and that bytecode is the low-level machine language of the JVM. Java is an object-oriented language; that is, it deals primarily with objects and their interrelationships. Objects are best thought of in this context as a collection of data … Read more

Hackers Are Using Coronavirus Maps to Spread Malware

Malware Outbreak Coronavirus outbreak dashboards — like this one, created by John Hopkins University — have become an extremely useful way to keep track of how the deadly virus is spreading across the globe. But hackers are creating fake coronavirus maps to infect users with malware. Doppelganger Security researcher Shai Alfasi at Reason Labs discovered … Read more

If statement in C programming

When we need to execute a block of statements only when a given condition is true then we use if statement. In the next tutorial, we will learn C if..else, nested if..else and else..if. C – If statement Syntax of if statement: The statements inside the body of “if” only execute if the given condition … Read more

C Keywords – Reserved Words

In C, we have 32 keywords, which have their predefined meaning and cannot be used as a variable name. These words are also known as “reserved words”. It is good practice to avoid using these keywords as variable name. These are – “auto, break, case, char, const, continue, double, default, do, else, enum, exturn, float, … Read more