Write a c program that creates a structure named student

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

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: EM132095299

Questions Cloud

What is the primary purpose of a supply chain : What is the primary purpose of a supply chain? Give an example of a supply chain functioning in the aviation industry
Rigour of strategic management as compared to commercial : Not-for-profit organisation do not need the rigour of strategic management as compared to commercial organisations.
Distinguish between the efficiency and effectiveness : Give an example to distinguish between the "Efficiency" and "Effectiveness" of a software application.
Analyze the bookstores current system : Analyze the bookstore's current system by drawing a context level DFD. Show the external entities and the data flows into and out of the system.
Write a c program that creates a structure named student : Write a C program that creates a structure named student with three members (name, last name and id).
What term is used to describe a type of communication : Which wireless technology enables low-power wide-area networks (LPWANs) for devices to communicate with other devices?
Why there are data redundancy : The basic user requirements are the following. You can add more assumptions or requirements to either complicate or simplify the problem.
What makes it projects different from other types of project : What makes IT projects different from other types of project? How should project managers adjust to these differences? Justify your response.
What is database recovery : What is Database recovery? Can The techniques for backup and recovery be used for disaster recovery?

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