C
C
C
#include<stdio.h>
void main()
{
int p,t,r,i;
printf("Enter the Principal, Time & Rate ");
scanf("%d %d %d",&p,&t,&r);
i=(p*t*r)/100;
printf("The Interest Amount is %d",i);
}
/* 47.The distance between two cities (in km.) is not input through the
keyboard.Write a program to convert and print this distance in meters, feet,
incehes and centimeters.*/
#include<stdio.h>
void main()
{
float km,mtr,ft,in,cm;
printf("Enter the Distance in Km ");
scanf("%f",&km);
mtr=km*1000;
cm=mtr*100;
ft=mtr*3.28;
in=ft*12;
printf("\n The Distance in Km is %.2f ",km);
printf("\n The Distance in Meter is %.2f ",mtr);
printf("\n The Distance in Centimeter is %.2f ",cm);
printf("\n The Distance in Feet is %.2f ",ft);
printf("\n The Distance in Inchs is %.2f ",in);
}
/* 48.if marks obtained by a student in five different subjects are input through
the keyboard, find out the aggremente marks and percentage marks obtained by the
student. assume that the maximum marks that can be obtanied by a satudent in each
subject is 100. */
#include<stdio.h>
void main()
{
int a,b,c,d,e,avg,tot,per;
printf("enter the marks of five subject ");
scanf("%d %d %d %d %d",&a,&b,&c,&d,&e);
tot=a+b+c+d+e;
avg=tot/5;
per=(tot*100)/500;
printf("\n The Total Mark is %d",tot);
printf("\n The Average marks is %d",avg);
printf("\n The Percentage Mark is %d %%",per);
}
50.the length & breadth of a rectangle and radius of circle are input through the
keyboard. write a program to calculate the area & perimeter of the rectangle and
the area and circumference of the circle.
#include<stdio.h>
void main()
{
int l,b,aor,por,r,aoc,coc;
printf("Enter the Length and Bredth of the rectangle ");
scanf("%d %d",&l,&b);
aor=l*b;
por=2*l+b;
printf("Enter the Radious of the Circle ");
scanf("%d",&r);
aoc=3.14*r*r;
coc=2*3.14*r;
printf("\n The Area of Rectangle is %d",aor);
printf("\n The Peremeter of Recgangle is %d",por);
printf("\n The Area of Circle is %d",aoc);
printf("\n The Circumference of the Circle is %d",coc);
}
/* 51. Two number are input through the keyboad into two location C and D. Write a
program to interchange the contins of C and D. */
#include<stdio.h>
void main()
{
int c,d,e;
printf("\n Enter the Value of c and d ");
scanf("%d %d",&c,&d);
e=c;
c=d;
d=e;
printf("\n The Value of c is %d and value of d is %d",c,d");
}
/* 52. If a five digit number is input through the keyboard, write a program to
calculate the sum of its digits. 31912*/
#include<stdio.h>
void main()
{
int a,sum=0,i;
printf("\n Enter the Value of a ");
scanf("%d",&a);
i=a%10;
sum=sum+i;
a=a/10;
i=a%10;
sum=sum+i;
a=a/10;
i=a%10;
sum=sum+i;
a=a/10;
i=a%10;
sum=sum+i;
a=a/10;
i=a%10;
sum=sum+i;
a=a/10;
#include<stdio.h>
void main()
{
float qty,rate,amt,dis=0;
printf(" Enter the Quantity and rate ");
scanf("%f %f",&qty,&rate);
if(qty>1000)
dis=10;
amt=(qty*rate)-(qty*rate*dis/100);
printf("The Total Expense is %f",amt);
}
/* The current and the year in which the employee joined the organization
are entered through the keyboard. If the number of years for which the
employee has served the organization is greater than 3, then a
bonus of Rs. 2500/- is given to the employee. If the year of service
are not greater than 3, then the program should do nothing. */
#include<stdio.h>
void main()
{
int cy,jy,yos,bonus=0;
printf("Enter the Current Year & Joining Year");
scanf("%d %d",&cy,&jy);
yos=cy-jy;
if(yos>3)
bonus=2500;
if sal >=1500
hra=500;
da=sal*98%
else
hra=10%
da=sal*90%
gross=sal+hra+da
print gross
#include<stdio.h>
void main()
{
float bs,da,hra,gross;
printf(" Enter the Basic Salary of the Employee ");
scanf("%f",&bs);
if(bs>=1500)
{
hra=500;
da=(bs*98)/100;
}
else
{
hra=(bs*10)/100;
da=(bs*90)/100;
}
gross=bs+da+hra;
/* The marks obtained by a student in 5 different subjects are input through the
keyboard. The students gets a division as per the following rules.
#include<stdio.h>
void main()
{
int m1,m2,m3,m4,m5,per;
printf("Enter the marks of 5 subjects ");
scanf("%d %d %d %d %d",&m1,&m2,&m3,&m4,&m5);
per=((m1+m2+m3+m4+m5)*100)/500;
if(per>=60)
printf("First Class");
else
{
if(per>=50)
printf("Second Class");
else
{
if(per>=40)
printf("Third Class");
else
printf("Fail");
}
}
============================== OR ===========================
#include<stdio.h>
void main()
{
int m1,m2,m3,m4,m5,per;
printf("Enter the marks of 5 subjects ");
scanf("%d %d %d %d %d",&m1,&m2,&m3,&m4,&m5);
per=((m1+m2+m3+m4+m5)*100)/500;
if(per>=60)
printf("First Class");
if(per>=50 && per<=59)
printf("Second Class");
if(per>=40 && per<=49)
printf("Third Class");
if(per<40)
printf("Fail");
}
=-============================ OR ==============================
#include<stdio.h>
void main()
{
long int m1,m2,m3,m4,m5,per;
printf("Enter the marks of 5 subjects ");
scanf("%ld %ld %ld %ld %ld",&m1,&m2,&m3,&m4,&m5);
per=((m1+m2+m3+m4+m5)*100)/500;
if(per>=60)
printf("First Class");
else if(per>=50)
printf("Second Class");
else if(per>=40)
printf("Third Class");
else
printf("Fail");
}
============================= OR ==============================
#include<stdio.h>
void main()
{
float m1,m2,m3,m4,m5,per;
printf("Enter the marks of 5 subjects ");
scanf("%f %f %f %f %f",&m1,&m2,&m3,&m4,&m5);
per=((m1+m2+m3+m4+m5)*100)/500;
if(per>=60)
printf("First Class");
else if(per>=50)
printf("Second Class");
else if(per>=40)
printf("Third Class");
else
printf("Fail");
}
#include<stdio.h>
void main()
{
char sex, ms;
int age;
printf("Enter the Age, Sex and martial status of the employee ");
scanf ("%d %c %c",&age,&sex,&ms);
if((ms=='M') || (ms=='U' && sex=='M' && age>=30) || (ms=='U' && sex=='F' &&
age>=25))
printf("Driver is insured");
else
printf("Driver is Not insured");
}
58. If Cost price and selling price of an item is input through the keyboard, write
a program to determine wheter the seller has made profit or incurred loss, also
determine how much profit he made or loss incurred.
#include<stdio.h>
void main()
{
int cp,sp;
printf("Enter the Cost & Selling Price ");
scanf("%d %d",&cp,&sp);
if(sp>cp)
printf("\n You have made a Profit of Rs. %d",sp-cp);
else
printf("\n You have made a loss of Rs. %d",cp-sp);
}
59. Any Integer is input through the keyboard, write a program to findout wheteher
it is odd or even number.
#include<stdio.h>
void main()
{
int x;
printf("Enter a Number ");
scanf("%d",&x);
if(x%2==0)
printf("\n Number is Even");
else
printf("\n Number is Odd");
}
Write a program, which will require the user to give values of hardness, carbon
content and tensil strength and the steel under consideration and output the grade
of the steel.
d) A library charges a fine for every book returned late. For first 5 days the fine
is 50 paise, for 6-10 days fine is one rupee and above 10 days fine is 5 rupees.
If you return the book after 30 days your membership will be cancelled. Write a
program to accept the number of days the member is late to return the book and
display the fine or the appropriate message.
==============================
if(x%2==0)
printf it is an even number
else
printf it is an odd number
==============================
================================
int h,ts;
float cc;
if(r>30)
printf Membership Cancelled
else if(r>10)
printf Fine is Rs. 5 Rupees
else if(r>5)
printf Fine is Rs. 1 Rupees
else
printf Fine is Rs. 0.50 Rupees
=================================================
printf Enter the time required for the employee
scanf %d, t
if(t>5)
printf Leave the Company
else if(t>4)
printf You required Trainning
else if(t>3)
printf You required to improve your speed
else
printf You are Highly Efficient
=====================================================
L O O P
=====================================================
#include<stdio.h>
void main()
{
int a=1; //INITIALIAZATION
while(a<=10) //CONDITION
{
printf("\n MIIT Computer Education"); //LOOPBODY
a=a+1; //INCREMENT
}
}
=====================================================
//Write a program to print all natural number from 50 to 1;
#include<stdio.h>
void main()
{
int a=50;
while(a>=1)
{
printf("%d \t",a);
a=a-1;
}
}
=====================================================
//Write a program to print all natural number from 50 to 1 USING do.......... while
loop;
#include<stdio.h>
void main()
{
int a=50;
do
{
printf("%d \t",a);
a=a-1;
}while(a>=1);
}
//Write a program to print all natural number from 1 to 50 USING for loop;
#include<stdio.h>
void main()
{
int a;
for(a=1;a<=50;a=a+1)
{
printf("%d \t",a);
}
}
//Write a program to print all natural number from 50 to 1 USING for loop;
#include<stdio.h>
void main()
{
int a;
for(a=50;a>=1;a--)
{
printf("%d \t",a);
}
}
//Write a program to print all natural number from 1 to 10 and 10 to1 USING for
loop;
#include<stdio.h>
void main()
{
int a,b;
for(a=1,b=10;a<=10,b>=1;a++,b--)
{
printf("%d \t %d \n",a,b);
}
}
/* 67. Write a program to find the factorial value of any number entered through
the keyboard. */
#include<stdio.h>
void main()
{
int fact=1,i;
printf("Enter a Number ");
scanf("%d",&i);
do
{
fact=fact*i;
i=i-1;
}while(i>=1);
printf("\n The Factorial Value is %d",fact);
}
/* Q1 : Display all the Natural number from 1 to 50. using for loop */
#include<stdio.h>
void main()
{
int a;
for(a=1;a<=50;a++)
{
printf("%d \t",a);
}
}
/* Q2 : Display all the Odd Number from 1 to 50. using for loop */
#include<stdio.h>
void main()
{
int a;
for(a=1;a<=50;a+=2)
{
printf("%d \t",a);
}
}
/* Q3 : Display all the Even Number from 1 to 50. using for loop */
#include<stdio.h>
void main()
{
int a;
for(a=0;a<=50;a+=2)
{
printf("%d \t",a);
}
}
while(num>1)
{
i=num%10;
rev=rev*10+i;
num=num/10;
}
printf("\n The Reverse Number is %d",rev);
}
/* 68. Two numbers are enterd through the keyboard, Write a program to find the
value of one number raised to the power of another. */
#include<stdio.h>
void main()
{
int a,b,c,d=1;
printf("Enter two number ");
scanf("%d %d",&a,&b);
for(c=1;c<=b;c++)
{
d=d*a;
}
printf("\n The Power Value is %d ",d);
}
/* 69. Write a program to print all the ASCII values and their equivalent character
using a for loop. The ASCII values vary from 0 to 255. */
#include<stdio.h>
void main()
{
int x;
for(x=0;x<=255;x++)
{
printf("%d=%c\t",x,x);
}
}
/* 69. Write a program to print all the ASCII values and their equivalent character
using a while loop. The ASCII values vary from 0 to 255. */
#include<stdio.h>
void main()
{
int x=0;
while(x<=255)
{
printf("%d=%c\t",x,x);
x++;
}
}
#include<stdio.h>
void main()
{
int a,b;
for(a=1;a<=6;a++)
{
for(b=1;b<=a;b++)
{
printf(" %d",a);
}
printf("\n");
}
}
======================================================
while(a<=10)
{
printf("%d x %d = %d \n",b,a,b*a);
a=a+1;
}
/* 10. Accept the Color Code and Show the Rainbow. (Switch Case ) VIBGYOR */
#include<stdio.h>
void main()
{
int a;
printf("Enter the Color Code ");
scanf("%d",&a);
switch(a)
{
case 1:
printf("\n This is Violet ");
break;
case 2:
printf("\n This is Indigo ");
break;
case 3:
printf("\n This is Blue ");
break;
case 4:
printf("\n This is Green ");
break;
case 5:
printf("\n This is Yellow ");
break;
case 6:
printf("\n This is Orange ");
break;
case 7:
printf("\n This is Red ");
break;
default:
printf("\n This is Wrong Input ");
}}
/* 13. Accept the 1st Letter of Days and Display the Day Name (Nested If / Switch
Case) */
#include<stdio.h>
void main()
{
char a;
printf("Enter the Day Code ");
scanf("%c",&a);
switch(a)
{
case 's':
printf("\n This is Sunday ");
break;
case 'm':
printf("\n This is Monday ");
break;
case 't':
printf("\n This is Tuesday ");
break;
case 'w':
printf("\n This is Wednesday ");
break;
case 'h':
printf("\n This is Thursday ");
break;
case 'f':
printf("\n This is Friday ");
break;
case 'a':
printf("\n This is Saturday ");
break;
default:
printf("\n This is Wrong Input ");
}}
/* 11. Accept two Number and a Operator then Calculate as per the Operator (Switch
Case) */
#include<stdio.h>
void main()
{
char op;
int a,b,c;
printf("Enter the Operator ");
scanf("%c",&op);
printf("Enter two Number ");
scanf("%d %d",&a,&b);
switch(op)
{
case '+':
c=a+b;
break;
case '-':
c=a-b;
break;
case '*':
c=a*b;
break;
case '/':
c=a/b;
break;
default:
printf("Wrong Input");
}
printf("\n The Result is %d ",c);
}
=======================================
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,d,e;
float g,h,i,j,k;
char ans='y';
while(ans=='y')
{
clrscr();
printf("\n ====================== MENU ===========================");
printf("\n\n 1. Simple Interest ");
printf("\n 2. Area & Peremeter of Circle ");
printf("\n 3. Area of Rectangle ");
printf("\n 4. Temperature from Ferhenite to Centigrade ");
printf("\n 5. Display all Odd Number from 1 to 100 ");
printf("\n 6. Display Even Number from 1 to 100 ");
printf("\n 7. Factorial Number ");
printf("\n 8. Exit ");
switch(a)
{
case 1:
printf("Enter the Principal, Time & Rate ");
scanf("%f %f %f",&g,&h,&i);
j=g*h*i/100;
printf("\n The Simple Interest After Calculation is %f",j);
break;
case 2:
printf("Enter the Radious of Circle ");
scanf("%f",&g);
h=2*3.14*g; //2xpixr = Circumference
i=3.14*g*g; //pixrxr = Area
printf(" \n The Circumference Value of the Circle is %f",h);
printf("\n The Area of the Circle is %f",i);
break;
case 3:
printf("\n Enter the Length & Width of the rectangle ");
scanf("%d %d",&b,&c);
d=b*c;
printf("\n The Area of the Rectangle is %d",d);
break;
case 4:
printf("\n Enter the Temperature in Ferhenite ");
scanf("%f",&g);
h=(g-32)*5/9;
printf("\n The Temperature in Centigrade is %f",h);
break;
case 5:
for(b=1;b<=100;b+=2)
{
printf("%d \t",b);
}
break;
case 6:
for(b=0;b<=100;b+=2)
{
printf("%d \t",b);
}
break;
case 7:
c=1;
printf("Enter a Number ");
scanf("%d",&b);
for(d=1;d<=b;d++)
{
c=c*d;
}
printf("\n The Factorial Value is %d",c);
break;
case 8:
printf("\n\n Thank you for Choosing MIIT Software Pvt. Ltd");
break;
default:
printf("\n !!!! Wrong Input !!!!");
break;
}
#include<stdio.h>
#include<math.h>
void main()
{
int x,r;
printf("Enter a Number ");
scanf("%d",&x);
r=sqrt(x);
printf("The Square root value is %d",r);
}
C:\TCWIN45\INCLUDE
===================================================
F U N C T I O N
===================================================
Generally Function are Divided into types.
1. User Defined Function
2. Predefined/ Inbuilt Function
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
add();
add();
add();
getch();
}
void add()
{
int a,b,c;
printf("Enter the two number ");
scanf("%d %d",&a,&b);
c=a+b;
printf("\n The value after calculation is %d",c);
}
=======================x========================
joga()
biyoga()
gunana()
harana()
tapa()
durata()
factrl()
======================/* Function for Temperature =tapa() argument with no return
value */
#include<stdio.h>
void tapa(int);
void main()
{
tapa(90);
}
void tapa(int f)
{
float c;
c=(f-32)*5/9;
printf("\n The Celcious Value is %f",c);
}
While the programmer like to reuse the retur value of function after calculation;
we have to use the argument with return value. In this case the function is used
just for calculation and return the Answer to which programmer can use once again
to the returned value.
#include<stdio.h>
void swap(int ,int);
void main()
{
int a=10,b=20;
swap(a,b);
printf("\n a= %d and b = %d",a,b);
}
===============================x=============
//Call By Reference Function
#include<stdio.h>
void swap(int *,int *);
void main()
{
int a=10,b=20;
swap(&a,&b);
printf("\n a= %d and b = %d",a,b);
}
#include<stdio.h>
#include<conio.h>
#define A (t>=450)
#define B (t>=350 && t<450)
#define C (t>=250 && t<350)
void main()
{
int x[9],i,t=0;
clrscr();
for(i=0;i<=8;i++)
{
printf("Enter the Mark ");
scanf("%d",&x[i]);
}
if(A)
printf("\n You got First Class");
else if (B)
printf("\n You Got Second Class");
else if (C)
printf("\n You Got Gandhi Division");
else
printf("\n Wow You Failed in the Examination ");
getch();
}
===================== P O I N T ER =================
i = 3
i = a variable
3 = value of i
65524 = location number
#include<stdio.h>
void main()
{
int i = 3;
printf(" \n Value of i is %d",i);
printf(" \n Address of i is %u",&i);
#include<stdio.h>
void main()
{
int i=3;
int *j;
j=&i;
============================
Standard Library String Function
============================
Function Use
strlen Finds Length of a string
strlwr Converts a string to lowercase
strupr Converts a string to uppercase
strcat Appends one string at the end of another
strncat Appends first n characters of a string at the end of another
strcpy() : This function copies the contents of one string into another. The base
address of the source and target string should be supplied to this function.
strcat () : This Function concatenates the source string at the end of the target
string. For Example "Bombay" and "Nagpur" on concatenation would result into a
string "BombayNagpur".
strcmp() : This is a function which compares two strings to find out whether they
are same or different. The two strings are compared character by character until
there is a mismatch or end of one of the string is reached, whichever occurs first.
If both are identical then strcmp() returns a zero value. If they are not it
returns the numeric difference between the ASCII values of the first non matching
pair of character.
======================================
#include<stdio.h>
#include<string.h>
void main()
{
int y;
char s[]="Narsh";
y=strlen(s);
printf("The length of the string is %d",y);
}
========================================
#include<stdio.h>
#include<string.h>
void main()
{
int x;
char s[20]="Narsh",t[20]="suresh";
strcpy(s,t);
printf("\n The value of t is %s",t);
printf("\nThe value of s is %s",s);
}
==========================================
#include<stdio.h>
#include<string.h>
void main()
{
int x;
char s[20]="Naresh",t[20]="suresh";
strcat(s,t);
printf("\n The value of t is %s",t);
printf("\nThe value of s is %s",s);
}
===========================================
#include<stdio.h>
#include<string.h>
void main()
{
int x;
char s[20]="Narsh",t[20]="Narein";
x=strcmp(s,t);
printf("\n The Difference is %d",x);
}
=================== A R R A Y ============================
One Dimentional Array int a[6];
6 7 21 65 48 35
21=a[2];
Two Dimentional Array int a[5][4]
54 32 65 98 85
32 65 54 87 25
15 26 29 28 27
35 36 39 37 32
15=a[0][2]
Multi Dimentional Array int a[2][5][4]
54 32 65 98 85
32 65 54 87 25
15 26 29 28 27
35 36 39 37 32
54 32 65 98 85
32 65 54 87 25
15 26 55 28 27
35 36 39 37 33 55=a[1][2][2]
#include<stdio.h>
void main()
{
int m[30],i;
for(i=0;i<=29;i++)
{
printf("Enter the Mark of student ");
scanf("%d",&m[i]);
}
printf("\n\nThe Marks are as follows \n\n");
for(i=0;i<=29;i++)
{
printf("%d \t",m[i]);
}
}
//Accept the Marks of 30 Students and Display marks & Total Mark.
#include<stdio.h>
void main()
{
int m[30],i,t=0;
for(i=0;i<=29;i++)
{
printf("Enter the Mark of student ");
scanf("%d",&m[i]);
}
printf("\n\nThe Marks are as follows \n\n");
for(i=0;i<=29;i++)
{
printf("%d \t",m[i]);
t=t+m[i];
}
printf("\n The Total Mark is %d",t);
}
============ TWO DIMENTIONAL ARRAY =================
#include<stdio.h>
void main()
{
int x[3][4],i,j;
for(i=0;i<=2;i++)
{
for(j=0;j<=3;j++)
{
printf("Enter the Number ");
scanf("%d",&x[i][j]);
}}
for(i=0;i<=2;i++)
{
for(j=0;j<=3;j++)
{
printf("%d\t",x[i][j]);
}
printf("\n");
}
=====================multi dimentional===================
#include<stdio.h>
#include<conio.h>
void main()
{
int x[5][2], y[5][2], z[5][2],i,j;
clrscr();
for(i=0;i<=4;i++)
{
for(j=0;j<=1;j++)
{
printf("Enter the Number ");
scanf("%d",&x[i][j]);
}}
for(i=0;i<=4;i++)
{
for(j=0;j<=1;j++)
{
printf("Enter the Number ");
scanf("%d",&y[i][j]);
}}
for(i=0;i<=4;i++)
{
for(j=0;j<=1;j++)
{
printf("%d \t",x[i][j]);
}
printf("\n");
}
printf("\n The 2nd Table of y \n\n");
for(i=0;i<=4;i++)
{
for(j=0;j<=1;j++)
{
printf("%d \t",y[i][j]);
}
printf("\n");
}
for(i=0;i<=4;i++)
{
for(j=0;j<=1;j++)
{
z[i][j]=x[i][j]+y[i][j];
}
printf("\n");
}
for(i=0;i<=4;i++)
{
for(j=0;j<=1;j++)
{
printf("%d \t",z[i][j]);
}
printf("\n");
}
getch();
}
c
============================ STRING FUNCTION ==========================
strlen()
strcpy()
strcat()
strcmp()
============================== /* Strlen()
#include<stdio.h>
#include<conio.h>
void main()
{
char y[]="Surendra Sahu";
int x;
x=strlen(y);
printf("\n The Length of the String is %d",x);
}
============================== /* Strcpy()
#include<stdio.h>
#include<conio.h>
void main()
{
char y[]="Surendra Sahu",x[]="Suchismita Sahu";
```strcpy(y,x);
printf("\n The value of x String is %s",x);
printf("\n The value of y String is %s",y);
}
int i=3; 3
int x[5]; 5 4 8 9 5
int x[2][3] 2 5 6
4 8 9
int x[2][3][4] 3 2 5 4
4 5 8 6
1 5 7 8
3 2 5 4
4 5 8 6
1 5 7 8
struct book b1
Book Name = Java
Nos of Page = 175
Amount = 97.65
Suppose you want to store data about a book. You might want to store its name (a
string), Its Price (a float) and number of Pages in it (an Int). If data about say
3 such books is to be store then we can follow two approaches.
1) Construct Individual array, one for storing names, another for storing price and
another for storing number of pages.
In this approach, no doubt, allows you to store names, prices and number of pages .
But as you must have reliazed, Its is unwidely approach that obsecures the fact
that you are dealing with a group of characteristics related to a single entity-
this book.
(A Structure contains a number of data types grouped together. These data types may
or may not be of the same type.)
#include<stdio.h>
void main()
{
struct book
{
int page;
char name[20];
float price;
};
struct book b1;
printf("Enter the Book Name, Nos of Pages and Price ");
scanf("%s %d %f",&b1.name,&b1.page,&b1.price);
// Automobile project
#include<stdio.h>
void main()
{
struct autom
{
char vname[20],rto[10];
float vamt,rta,inc;
};
struct autom x;
printf("Enter the Vechile Name, RTO Number & Amount ");
scanf("%s %s %f",&x.vname,&x.rto, &x.vamt);
x.rta=(x.vamt*10)/100;
x.inc=(x.vamt*15)/100;
printf("You have choosen %s Vechile, having RTO Number %s and Costs %f, Road Tax %f
and Insurance %f",x.vname,x.rto,x.vamt,x.rta,x.inc);
printf("Roll\tName\tFees");
for(x=0;x<=4;x++)
{
printf("\n%d\t%s\t%f",s[x].roll,s[x].name,s[x].fees);
}
printf("Roll\tName\tFees");
for(x=0;x<=4;x++)
{
printf("\n%d\t%s\t%f",s[x].roll,s[x].name,s[x].fees);
sum=sum+s[x].fees;
}
printf("\n The Total Fees Balance from Student is %d",sum);
}
========================================================================