Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

problem1)a) Find the errors in the following program:

# Include
main( )
{
print (‘Learning C is not\n a difficult task’);
return ( );
}

b) If a, b, c are int variables and a - 2, b - 4, c-3, d-5, what is the value of the expression a/b/c*d-a+c*d/b-c. Justify your answer.

c) Which of the following are valid C identifiers?

i) variable name 

ii) 2ndchance

iii) alpha++

iv) Motor-Car

v) register

vi) Saving Account

d) prepare the following operators from lowest to highest precedence:

i) ( ), <, ||, ?, +, *, ++

ii) /, !=, &, -, ~, [], +=

problem2)a) Consider the program

1 #include
2 int main ()
3 {
4 int a;
5 char b;
6 float c;
7 printf ("Enter the values of a, b, c");
8 scanf ("%d%c%f",&a, &b, &c);
9 printf ("%d%c%f",&a,&b,&c);
10 return 0;
11 }

If the input is a-2.5, b-234, c-89, what is the output. describe your answer.

b) What will be the output of the following program? Justify your answer.

#include
Int main()
{
Int x, y, z;
x=10;y=20;z=5;
x=z+y++;
printf("x=%d,y=%d,z=%d\n",x,y,z);
x=10;y=20;z=5;
y=z+ --y/x++;
printf("x=%d,y=%d,z=%d\n",x,y,z);
x=10;y=20;z=5;
z+=x*y-- %10;
printf("x=%d,y=%d,z=%d\n",x,y,z);
x=10;y=20;z=5;
x-=x%z-(x+--z%z);
return 0;
}

c) describe the output of the following C program:

1 # include
2 # include
3 int main ( )
4 {
5 int count;
6 for (count = 1; count <= 100; count ++)
7 i f (pow (floor (sqrt (count + 0.0)), 2) == count)
8 printf ("% d", count);
9 printf ("\n");
10 return 0;
11 }

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M92595
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question? 


Related Questions in C/C++

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 ...

Object-oriented programming assignmentintroduction -nbspa

Object-Oriented Programming Assignment Introduction -  "A logical matrix or (0, 1) matrix is a matrix with entries from the Boolean domain B = {0, 1}. Such a matrix can be used to represent a binary relation between a pa ...

Assignmentpart acomplete the following questionswrite c

Assignment Part A Complete the following questions: Write C++ code to open a document with the name Hello.txt, place the message "Hello, World!" in the document, and exit the document. Re open the file you closed, and re ...

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 ...

Assignment part acreate a checkbook program using c

Assignment (part a) Create a Checkbook program using C : • Create a Check structure. Include:   o Check number (should be an integer).   o Date (use type char[ ]).   o To   o Amount   o Description • Add functions to:   ...

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 ...

C projectphase 11- you need to take input from user study

C project Phase 1 1- You need to take input from user study year (proper value check from 1 to 4) 2- Take input semester (proper value check 1 to 8) 3- Calculate GPA (use Loop, calculate GPA for semester 1,2,3...) Exampl ...

Write a program that reads numbers from cin and then sums

Write a program that reads numbers from cin and then sums them, stopping when 0 has been entered. Construct three versions of this program, using the while, do - while , and for loops. Add the following to your program: ...

1 we know that from ece 109 to calculate the

1. We know that from ECE 109, to calculate the equivalent resistance of a network of resistors in series in parallel are given by: Write a C++ program that asks the user to input values for resistors (as many as they wou ...

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 ...

  • 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

WalMart Identification of theory and critical discussion

Drawing on the prescribed text and/or relevant academic literature, produce a paper which discusses the nature of group

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