Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A24 - WAP to implement your own isxdigit() function Available from : Thursday, 9 June 2022, 4:21 PM Due date : Wednesday, 10 July 2024,

A24 - WAP to implement your own isxdigit() function

Available from: Thursday, 9 June 2022, 4:21 PM Due date: Wednesday, 10 July 2024, 11:45 PM Requested files: isdigit.c ( Download) Type of work: Individual work Reduction by automatic evaluation: 10 Free evaluations: 10

Description:

c-type library functions check whether ch, which must have the value of an unsigned char or EOF, falls into a certain character class according to the current locale.

isxdigit() - checks for a hexadecimal digit i.e. given character is between '0' - '9' or 'a' - 'f' or 'A' - 'F'

Pr-requisites: -

Functions

Objective: -

To understand the concept of

Functions

Inputs: - An ASCII character Outputs: - 0 or non-zero value based on condition success or failure Sample execution: - Test Case 1: user@emertxe] ./is_xdigit Enter the character: a Entered character is an hexadecimal digit Test Case 2: is_xdigit Enter the character:3 Entered character is an hexadecimal digit Test Case 3: is_xdigit Enter the character:G

Entered character is not an hexadecimal digit

requested file

#include

int is_xdigit(int);

int main() { char ch; short ret; printf("Enter a character: "); scanf("%c", &ch); ret = is_xdigit(ch); /* Based on the return value of the function print the message */ return 0; }

//

2 - Print the values in sorted order without modifying or copying array

Description:

Read n and n no.of elements from user and store them into an array.

Run a loop for printing the elements in sorted order.

Pr-requisites:-

Functions

Arrays

Pointers

Objective: -

To understand the concept of

Functions, Arrays, and Pointers

Inputs: - Array on N integer, N Sample execution: - Test Case 1: Enter the size : 5 Enter 5 elements 10 1 3 8 -1 After sorting: -1 1 3 8 10 Original array values 10 1 3 8 -1 Test Case 2:./sort Enter the size : 7 Enter 7 elements 1 3 2 5 4 7 6 After sorting: 1 2 3 4 5 6 7 Original array values 1 3 2 5 4 7 6 Test Case 3: Enter the size : 4 Enter 4 elements -1 -2 4 3 After sorting: -2 -1 3 4 Original array values -1 -2 4 3

requested file

#include

void print_sort(int [], int);

int main() { int size, iter; printf("Enter the size of the array : "); scanf("%d", &size); int arr[size]; printf("Enter the %d elements "); for (iter = 0; iter < size; iter++) { scanf("%d", &arr[iter]); } print_sort(arr, size); }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions