Write a C program to calculate the area & perimeter of the rectangle, and the area & circumference of the circle

C Programming Tutorial

Problem Statement: The length & breadth of a rectangle and radius of a circle are input through the keyboard. Write a program to calculate the area & perimeter of the rectangle, and the area & circumference of the circle. Answer: /* Calculation of perimeter and area of rectangle and circle */ #include<stdio.h> #include<conio.h> main() { … Read more

write a C program for Conversion of Temperature from Fahrenheit to Centigrade

C Programming Tutorial

Problem Statement: Temperature of a city in Fahrenheit degrees is input through the keyboard. Write a c program to convert this temperature into Centigrade degrees. Answer: /* Conversion of Temperature from Fahrenheit to Centigrade */ #include <stdio.h> #include <conio.h> main() { float fr, cent; clrscr(); print(“\n Enter the temperature in Fahrenheit:”); scanf(“%f”, &fr); cent=5.0/9.0*(fr-32); printf(“\n … Read more

Write a c program for Calculation of aggregate and percentage marks

C Programming Tutorial

Problem Statement: If the marks obtained by a student in five different subjects are input through the keyboard, find out the aggregate marks and percentage marks obtained by the student. Assume that the maximum marks that can be obtained by a student in each subject is 100. Answer: /* Calculation of aggregate and percentage marks … Read more

Summary of C learning – First program in C

C Programming Tutorial

The three primary constants and variable types in C are integer, float and character. A variable name can be of maximum 31 characters. Do not use a keyword as a variable name. An expression may contain any sequence of constants, variables and operators. Operators having equal precedence are evaluated using associativity. Left to right associativity … Read more

Control Instructions in C

C Programming Tutorial

As the name suggests the ‘Control Instructions’ enable us to specify the order in which the various instructions in a program are to be executed by the computer. In other words the control instructions determine the ‘flow of control’ in a program. There are four types of control instructions in C. They are: Sequence Control … Read more

Hierarchy of Operations in C

C Programming Tutorial

While executing an arithmetic statement, which has two or more operators, we may have some problems as to how exactly does it get executed. For example, does the expression 2 * x – 3 * y correspond to (2x)-(3y) or to 2(x-3y)? Similarly, does A / B * C correspond to A / (B * … Read more

Integer and Float Conversions in C

C Programming Tutorial

In order to effectively develop C programs, it will be necessary to understand the rules that are used for the implicit conversion of floating point and integer values in C. These are mentioned below. Note them carefully. An arithmetic operation between an integer and integer always yields an integer result. An operation between a real … Read more

C Instructions

C Programming Tutorial

We have seen the first c program, Now let us look at the instructions that we used in these programs. There are basically three types of instructions in C: Type Declaration Instruction – To declare the type of variables used in a C program. Arithmetic Instruction – To perform arithmetic operations between constants and variables Control Instruction … Read more

Scanf() : Receiving input in C program

C Programming Tutorial

In the First C Program discussed earlier (same has been also mentioned below for the reference) we assumed the values of p, n and r to be 1000, 3 and 8.5. Every time we run the program we would get the same value for simple interest. If we want to calculate simple interest for some other … Read more

Javascript with Cookies

java script

Cookie is simply a variable that your webpage can store on or retrieve from the user’s computer to host machine. Examples of cookies could be: First time the visitor arrives the name is entered.(for example “John Wayne”). The username is then stored in a cookie. Next time he arrives at your page, it writes something … Read more