Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

problem1)a) In the following C program, what are the functions used?

# include
# include
i n t main()
{
Char  s1[15] = "Hello World";
i f (strchr(s1, ’e’))
printf("The character e occurs in the string.\n");
else printf("The character e does not occur in the string.\n");
return 0;
}

b) Which of the following are valid integer constants? Give reasons for your answer.

i) 123456L

ii) 12.5

c) How will you represent the following as a float constants?

i) 29979925 X 104

ii) 661 X 10-29

d) Which of the following are valid C identifiers? Give reasons for your answer.

i) 2ABC

ii) _ABC

iii) Double

problem2)a) What are the errors in the following C program?

1 # include
2 int main()
3 {
4 float distance,speed,time;
5 printf("Enter Distance travelled in Km.\n"/* get distance travelled * /);
6 scanf("%f",&Distance);
7 printf("Enter time taken in hours.\n");
8 scanf("%f",time);
9 Speed = distance/time;
10 printf("The speed is %f Km/hr.",speed);
11 return 0;
12 }

C/C++, Programming

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

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

Modules in c are called functions c programs are typically

Modules in C are called functions. C programs are typically written by combining user created functions as well as "pre-packaged" functions found in the C Standard Library. For instance, printf() is a function that is fo ...

Bankers algorithmimplement the bankers algorithm for

Banker's Algorithm Implement the Banker's algorithm for deadlock avoidance, that works on a given set of N processes and M resource types (N The input data and result is then displayed on the screen. You may use your pro ...

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

Programming assignment image processing - pointers class

Programming Assignment: Image Processing - Pointers, Class & Dynamic Data This project is called "Image Processing" which will shrink an input image, convert a color image to gray image , add random noise to an image, ad ...

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

Intro to programming in c assignmentsince this is the last

Intro to Programming in C Assignment Since this is the last assignment, there will be no late submission. All programs must be electronically submitted by 5:00pm on Tuesday, December 2nd with NO EXCEPTIONS in order to re ...

A compiler that translates a high-level language into

A compiler that translates a high-level language into another high-level language is called a source-to-source translator. What advantages are there to using C as a target language for a compiler?

Assignmentinstructionsthis assignment is to implement your

Assignment Instructions This assignment is to implement your own mini-grocery store in C++. Suppose you have the following Food hierarchy: FOOD FRUIT APPLE BANANA GRAPE DAIRY MILK YOGURT CHEESE (your choice) (three items ...

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

  • 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