C Program Structure:-
सी प्रोग्राम का स्ट्रक्चर निम्न है -
1.) Include section
//pre processor directives like #include.
2.) Define global constants/macro
//pre processor directives #define or extern storage class variables/constant.
3.) Other functions definition (pre processor)
4.) Main function
a.) Variable Declaration/Initialization.
b.) Declaration of other functions (post processor)
b.) Executable Statements.
5.) Other functions definition (post processor)
Example:-
C Program for Simple Interest-
file:- si.c
#include<stdio.h>
#include<conio.h>
int main(){
float p,r,t,si;
clrscr();
printf("Enter Principal,Rate and Time\n");
scanf("%f%f%f",&p,&r,&t);
si=p*r*t/100;
printf("Simple Interest=%f",si);
getch();
return 1;
}
Other Examples :-
C program to calculate simple interest.
C program to find ASCII value of given character
C program to find area of triangle using Heron's formula
C program to calculate addition, subtraction, multiplication and division of two numbers.
C program to find area and circumference of circle when radius is given.
C program to swap value of two variables without using third variable.
C program to swap value of two variables using third variable.
C program to find square,cube and square root of a number.
C program to calculate gross salary of an employee when basic salary is given.
सी प्रोग्राम का स्ट्रक्चर निम्न है -
1.) Include section
//pre processor directives like #include.
2.) Define global constants/macro
//pre processor directives #define or extern storage class variables/constant.
3.) Other functions definition (pre processor)
4.) Main function
a.) Variable Declaration/Initialization.
b.) Declaration of other functions (post processor)
b.) Executable Statements.
5.) Other functions definition (post processor)
Example:-
C Program for Simple Interest-
file:- si.c
#include<stdio.h>
#include<conio.h>
int main(){
float p,r,t,si;
clrscr();
printf("Enter Principal,Rate and Time\n");
scanf("%f%f%f",&p,&r,&t);
si=p*r*t/100;
printf("Simple Interest=%f",si);
getch();
return 1;
}
Other Examples :-
C program to calculate simple interest.
C program to find ASCII value of given character
C program to find area of triangle using Heron's formula
C program to calculate addition, subtraction, multiplication and division of two numbers.
C program to find area and circumference of circle when radius is given.
C program to swap value of two variables without using third variable.
C program to swap value of two variables using third variable.
C program to find square,cube and square root of a number.
C program to calculate gross salary of an employee when basic salary is given.
No comments:
Post a Comment