diff --git a/Other Questions/Arrays/05/05.c b/Other Questions/Arrays/05/05.c new file mode 100644 index 0000000..4646489 --- /dev/null +++ b/Other Questions/Arrays/05/05.c @@ -0,0 +1,38 @@ +#include +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; +} diff --git a/Other Questions/Question 13/1.c b/Other Questions/Question 13/1.c new file mode 100644 index 0000000..25b15ad --- /dev/null +++ b/Other Questions/Question 13/1.c @@ -0,0 +1,72 @@ +#include + +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; +} diff --git a/Other Questions/Question 13/IP model paper.pdf b/Other Questions/Question 13/IP model paper.pdf new file mode 100644 index 0000000..0a0fade Binary files /dev/null and b/Other Questions/Question 13/IP model paper.pdf differ