Question
Hello. This is in C Edit the program which will run with the following command line a.out ??????x???? where the second command line argument starts
Hello. This is in C
Edit the program which will run with the following command line
a.out ??????x????
where the second command line argument starts with some unknown number of digits (0-9) followed by the lowercase letter x and then another unknown number of digits (0-9). Your program should identify the two integer values before and after letter x, and print them out on the screen using printf(...... %d, ...)
#include
#include
int main(int argc, char *argv[])
{ int n, m; // dimension of the game board
char s[10]; // before they learn DMA
int i=0, j=0;
if (argc != 2)
{ printf("a.out ???x?????? ");
exit(0);
}
// add your code here to determine the values of n and m
printf("n = %d m = %d ", n, m);
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started