The following is a two-dimensional character array of size 12X12 which represents a maze. The symbol ‘#’ represent a wall of the maze and the symbol ‘.’ represents a possible path. There is an entry point and exit point of the maze, which are denoted by a ‘.’ Write a C program which takes text file which contains the maze as command line argument and prints the minimum number of moves required to go from entry to exit. If there is no path from entry to exit display “-1”. You need to formulate the maze as a graph and use Breadth First Search to find shortest path from entry to exit. You can treat each cell as a vertex and if we can go from one cell to other cell with one move add edge between the corresponding vertices. For example, for the below maze:
############
. . . ##. ##. . .#
##. . . . . . . .##
#. .######. ##
####. . . . . . .#
# . . . .#. ###.#
###. . . . . . . .#
#. . .######. #
#####. . .#. .#
#. . .#. #. #. ##
#.#. . .#. . . . .
############
Min moves: 22
47:06
1 / Sample code to read input and write output
3- /"
4 #include <stdio.h>
6 int main() 7- (
char name[20]; scanf("%s" name);
printf("hello Ns", hame);
return 0;
77 Warning: Printing unwanted or-111-forestal dete to outati che th
#include<stdio.
Read Input from STOIN
19 int main()
20- ( 21 22 23 3
11 Write your code here return p
I
21°C Rain showe
Communication Technologies have influenced history. Even
now, ICT is playing a big role. To have a creative take on the topic, compose a poem inspired by
current issues, changes, or trends we are exposed to because of ICT. Write your poem on the
space provided.
by CodeChum Admin
The square of an integer refers to the result of multiplying the integer with itself once. While the cube of an integer refers to the result of multiplying the integer with itself twice. As long as you know that, you could easily solve this!
Instructions:
Input
1. First integer
2. Second integer
3. Third integer
Output
The first three lines will contain message prompts to input the three integers.
The last line contains "Positive" or "Negative"
Enter the first integer: 1
Enter the second integer: 2
Enter the third integer: 3
PositiveEnter the first integer: 1
Enter the second integer: -5
Enter the third integer: 4
NegativeCreate a C program to find the total number of of illiterate men and women from the population in the town.If the percentage of men is 54 from the population, and total literacy is 80% from the population.Then the total population is input to the keyboard.
Write a C program to count the number of non-zero elements and sum of upper triangular
in a two-dimensional matrix using function. [Hint function should accept 2D array as
argument.]
write a c program to define a structure called a car. the member elements of the car structure are model(like bmw, ford...etc), production year (1999,2020,...), and lastly price. create an array of 10 cars. get input for all 10 cars from the user. then the program display complete information (model, year, price) of those cars only which are above 250000 in price or production date bigger than 2000.
by CodeChum Admin
We’ve tried adding together integers, so how about adding characters as well? Well, we can’t do that with the knowledge we have now, so let’s use placeholders to do the trick!
Instructions:
Input
1. First character
2. Second character
Output
The first two lines will contain message prompts to input the two characters.
The last line contains the two characters together.
Enter·the·first·character:·A
Enter·the·second·character:·B
AB
by CodeChum Admin
Now that we're done with integers, we're moving on to decimals!
Instructions:
Input
1. First decimal number
2. Second decimal number
3. Third decimal number
Output
The first three lines will contain message prompts to input the three decimal numbers.
The last line contains the result in two decimal places.
Enter·the·first·number:·1.53
Enter·the·second·number:·2.25
Enter·the·third·number:·1.23
Result·=·2.80
write a program to define a structure called a car. the member elements of the car structure are model(like bmw, ford...etc), production year (1999,2020,...), and lastly price. create an array of 10 cars. get input for all 10 cars from the user. then the program display complete information (model, year, price) of those cars only which are above 250000 in price or production date bigger than 2000.