Ask Question, Ask an Expert


Ask C/C++ Expert

Home >> C/C++

problem 1)a)(i) Distinguish between realloc() and malloc() function in C.

(ii) Describe the purpose of each of the following declarations

1. int *p[10];

2. int (*p) [10];

3. int p (char *a);

4. int *p (char *a);

b) prepare a C program using pointers to read the array of integers and prints its elements in descending order.

problem 2)a) Differentiate union and structure. For what types of applications are unions useful?

b) Describe with suitable exs self referencing structure.

c) Describe nesting of structure with suitable ex. Can union be member of Structure and structure be a member of union? If yes, give suitable ex.

problem 3)a) What do you mean by the array of structures? Describe with appropriate ex.

b) Describe how to pass entire structure as parameter to function and how to return a structure from function.

c) Define a structure called Inventory that will describe following information:

i) Item_No

ii) Item_Name

iii) Unit_Price

iv) Quanitity_Recieved

v) Current_Count

vi) Supplier_Name

vii) Purchase_Date

Purchase_Date is member of another 'Date' structure. Using Inventory create array of items and prepare a C program to read the information about all items. While displaying final list find out and display the purchase price for each shipment. Sort the list in ascending order of Item_No.

problem 4)a) prepare a C program to count number of spaces on each line of text in a file.

b) Describe the following file handling functions in C with appropriate ex:

i) feof()

ii) ferror()

iii) fseek()

iv) ftell()

problem 5)a) prepare down the difference between text mode and binary mode.

b) prepare a C program to read integer number from user and display it in binary format using bitwise operator.

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M95679

Have any Question? 

Related Questions in C/C++

1 write a c program that allows the user to create a test

1. Write a C++ program that allows the user to create a test bank of questions 2. The program should first ask the user how many questions he or she wishes to create. 3- The user should now be prompted for all informatio ...

Assignmentthis is the programthis program will use 2

Assignment This is the program: This program will use 2 different data structures to perform the same tasks; a vector and a dynamically sized array Write a complete C++ program that will: Declare a vector of integers wit ...

Projectdecision statementsdirections read carefully and

Project: Decision Statements Directions (Read CAREFULLY and follow COMPLETELY): - Create the following programs in C++ that perform the purpose described and show the sample output (with user input where applicable). - I ...

Write a c program that requests the name of any cartoon

Write a C program that requests the name of any cartoon character from the user, then does the following with that name (use printf for each): a. Displays it enclosed in double quotes. b. Displays it in a field 24 charac ...

C-programmingcreate a c program that sorts a sequence of

C-Programming Create a C program that sorts a sequence of positive numbers using the bubble sort algorithm in an increasing or decreasing order based on the user's choice. The pseudo code for the bubble sort algorithm is ...

Assessment taskthis coursework will allow you to

Assessment Task: This coursework will allow you to investigate some of the issues involved in writing threaded programs. You are to write a series of simple programs in C/C++ that will run under Linux, to illustrate how ...

Cs 2410workshop make-up assignmentwrite a c program that

CS 2410 Workshop Make-Up Assignment Write a C++ program that will output to a file called output.txt EVERY 10 digit phone number from 713-000-0000 through 713-000-0998. These numbers MUST only contain an odd number of ev ...

Transaction processing system tpsxyz electronics is one of

Transaction Processing System (TPS) XYZ Electronics is one of the most popular electronics companies In Sultanate of Oman the company offers affordable electronic gadgets such as mp3 players, portable movie players, mobi ...

Write a console-based c program that can be used as a math

Write a console-based C++ program that can be used as a math tutor for a young student. The program should display two random numbers consisting of three digits each to be added in columnar format, such as: 247 +129 ---- ...

Cosci 21a programming assignmentpurpose experience with

COSCI 21a, Programming Assignment Purpose: Experience with some basic data structures, including circular queues, linked lists, hash tables, and specifically with pointers and the associated dynamic memory allocation. Pr ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen