Write a c program that creates a union named users

Assignment Help C/C++ Programming
Reference no: EM132095711

Please help!!!

1. Write a C program that creates a structure named student with three members (name, last name and id).
Enter 2 student's information and save it in a txt file.

2. Write a C program that creates a union named "users" with two members (last name and email).
Enter 3 users's information, print it (make sure you print the correct values) and save the correct values in a txt file.

3. What is wrong or missing in this code to avoid errors or warnings?

#include<stdio.h>
#include<conio.h>
void main() {
union details {
struct student st;
};
union details set;
printf("Enter details:");
printf("\nEnter FIrst name : ");
scanf("%s", set.st.first_name);
printf("\nEnter id : ");
scanf("%d", &set.st.id);

printf("\nFirst name : %s", set.st.first_name);
printf("\nId : %d", set.st.id);
getch();
}

4. What is wrong or missing in this code to avoid errors or warnings?

#include <stdio.h>
int main() {
char buff[255];

fp = fopen("C:\\temp\\test1.txt", "r");
fscanf(fp, "%s", buff);
printf("1 : %s\n", buff );

fgets(buff, 255, (FILE*) );
printf("2: %s\n", buff );

return 0;

}

5. Write a program to insert the binary sequence [1 0 0 0 1 0 1 1] in a register named "my_register" using bit fields."

Reference no: EM132095711

Questions Cloud

Determine the coefficient of performance of the refrigerator : The food compartment of a refrigerator is maintained at 4°C by removing heat from it at a rate of 360 kJ/min. If the required power input to the refrigerator.
Prepare a multiple-step income statement for the year ended : Prepare a multiple-step income statement for the year ended December 31, 2014. Compute the gross margin percentage and net profit margin ratio
How many photons are emitted each second : A helium-neon laser emits red light having a wavelength of 6.4 x 10-7 m and a power of 0.5 mW. How many photons are emitted each second?
Evaluate professional practice issues in business research : Evaluate professional practice issues in business research - Evaluate the impact of existing business research in a business environment
Write a c program that creates a union named users : Write a C program that creates a union named "users" with two members (last name and email).
Is momentum conserved in all of the experiments : Is momentum conserved in all of the experiments? Please give a complete description with examples as needed supporting your response.
Discussion assignment-international law : Read the questions below. Then find the information requested about the International Criminal Court (ICC) and the International Court of Justice
Determine the fair value of identifiable net assets : Dennis Company purchases Miles Company for $5,000,000 cash on January 1, 2018. Determine the fair value of identifiable net assets used to record goodwill
What is the polarizing angle for the substance : The critical angle for total internal reflection for a substance is 45o. What is the polarizing angle for this substance?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd