Posts

Showing posts with the label let us c solutions

The case Control Structure Let us C solution

  The case Control Structure | Let us C solution with details description and tutorials |  yashwant kanetkar S.N Chapter S.N Chapter 1 Decision Control Structure 5 Arrays 2 The Loop Control Structure 6 Puppetting On Strings  3 The Case Control Structure 7 Structures 4 Function and Pointer 8 Input/Output in C [C] Write a menu driven program which has following options:  1. Factorial of a number.  2. Prime or not  3. Odd or even  4. Exit Make use of switch statement. The outline of this program is given below: /* A menu driven program */ main( ) { int choice ; while ( 1 ) { printf ( "\n1. Factorial" ) ; printf ( "\n2. Prime" ) ; printf ( "\n3. Odd/Even" ) ; printf ( "\n4. Exit" ) ; printf ( "\nYour choice? " ) ; scanf ( "%d", &choice ) ; switch ( choice ) { case 1 : /* logic for factorial of a number */ break ; case 2 : /* logic for deciding prime number */ break ; case 3 : /* logic for

The Loop Control Structure | Let us C solution with details description and tutorials | yashwant kanetkar

The Loop Control Structure | Let us C solution with details description and tutorials |  yashwant kanetkar S.N Chapter S.N Chapter 1 Decision Control Structure 5 Arrays 2 The Loop Control Structure 6 Puppetting On Strings  3 The Case Control Structure 7 Structures 4 Function and Pointer 8 Input/Output in C [B] Attempt the following: (a)Write a program to calculate overtime pay of 10 employees. Overtime is paid at the rate of Rs. 12.00 per hour for every hour worked above 40 hours. Assume that employees do not work for fractional part of an hour. Show Solutions     Hide Solutions /*b (a)Write a program to calculate overtime pay of 10  employees. Overtime is paid at the rate of Rs. 12.00   per hour for every hour worked above 40 hours. Assume   that employees do not work for fractional part of an hour.  */ #include <stdio.h>  //header file #include <conio.h>   //header file int main()        //main function.. starting of c code {  int

Chapter: Decision Control Structure | Let us C solution with details description and tutorials | Yashwant Kanetkar

Chapter: Decision Control Structure  | Let us C solution with details description and tutorials | Yashwant Kanetkar |  S.N Chapter S.N Chapter 1 Decision Control Structure 5 Arrays 2 The Loop Control Structure 6 Puppetting On Strings  3 The Case Control Structure 7 Structures 4 Function and Pointer 8 Input/Output in C if,if-else,Nested if-else [C] Attempt the following: (a) If cost price and selling price of an item is input through the keyboard, write a program to determine whether the seller has made profit or incurred loss. Also determine how much profit he made or loss he incurred. Show Solutions     Hide Solutions Chapter: Decision Control Structure /* C (a)If cost price and selling price of an item is input through  the keyboard, write a program to determine whether the seller  has made profit or incurred loss. Also determine how much  profit he made or loss he incurred.*/ #include <stdio.h>  //header file #includ