Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create 05.c #105

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions Other Questions/Arrays/05/05.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#include <stdio.h>
int main()
{
int arrNum[6];
int i,j;

printf("Enter values to the array :\n");

for(i=0;i<5;i++)
{
scanf(" %d\n", &arrNum[i]);
}

for(i=0;i<6;i++)
{
if(arrNum[i] <= arrNum[i+1])
{
j = 1;
}
else
{
j = 0;

}
}

if(j == 1)
{
printf("\nNumbers are stored in ascending order");
}
else
{
printf("Numbers are not stored in ascending order");
}


return 0;
}
41 changes: 41 additions & 0 deletions Other Questions/Arrays/06-Matrix Subtraction/Untitled2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#include <stdio.h>

int main()
{
int Arr1[3][3];
int Arr2[3][3];
int i,j;

printf("Enter values to the matrix1 : \n");

for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
scanf("%d", &Arr1[i][j]);
}

}

printf("\n\nEnter values to the matrix2 : \n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
scanf("%d", &Arr2[i][j]);
}

}

printf("\n\nMatrix subtraction :\n");

for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("%3d ",(Arr1[i][j] - Arr2[i][j]));
}
printf("\n");
}
return 0;
}
72 changes: 72 additions & 0 deletions Other Questions/Question 13/1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#include <stdio.h>

int main()
{
char roomType, method,con;
int rooms, nights,perNight,sum;
float discount,tot,dis;

sum = 0;

while(con != 'N' && con != 'n')
{
printf("Input room type :");
scanf(" %c", &roomType);

printf("Enter number of rooms :");
scanf("%d", &rooms);

printf("Enter number of nights :");
scanf("%d", &nights);

if(roomType == 'D')
{
perNight = 31000;
}
else if(roomType == 'S')
{
perNight = 35000;
}
else if(roomType == 'C')
{
perNight = 50000;
}
else if(roomType == 'E')
{
perNight = 75000;
}
else if(roomType == 'P')
{
perNight = 100000;
}
else
{
printf("Invalid room type");
break;
}

sum = sum + (perNight * nights * rooms);

printf("Do you want to continue :");
scanf(" %c", &con);
}
printf("Enter paying method :");
scanf(" %c", &method);

if(method == 'C')
{
discount = 10/100.0;
}
else
{
discount = 0;
}


dis =sum * discount;
tot = sum - (dis);
printf("You HAVE %.2f discount ",dis);
printf("\nFinal bill amount is : %.2f",tot);

return 0;
}
Binary file added Other Questions/Question 13/IP model paper.pdf
Binary file not shown.