Home Answers Viewqa Development-process about a program in c language

 
 


patchi maher
about a program in c language
1 Answer(s)      2 years and a month ago
Posted in : Development process

Write a program that inputs five different integers from the keyboard, then print the sum, the product, the smallest and the largest of these numbers. Use only single selection form of if statement. For example: 1 3 2 7 4 6 Sum is: 23 Average is: 4.5 Smallest: 1 Largest 7

View Answers

March 31, 2011 at 5:16 PM


    #include <stdio.h>
    #include <conio.h>

    int main(void){
      int num = 0;
      int sum = 0;
      int counter = 0;
      int min=0;
      int max=0;
      int temp;
      int product=1;
      while(counter < 5){
      printf("Enter number: ");
      if(scanf("%d", &num) == 1){
      if(num>=max){
         max=num;
      }
      if(num<=temp){
         min=num;
      }
      temp=num;
      sum += num;
      product*=num;
    }
    else{
      fprintf(stderr, "Error!");
      return 0;
    }
    counter++;
  }
  printf("Sum of numbers entered: %d\n", sum);
  printf("Product of numbers entered: %d\n", product);
  printf("The largest number is :%d\n",max);
  printf("The smallest number is :%d",min);

  return 0;
}









Related Pages:
about a program in c language
about a program in c language   Write a program that inputs five different integers from the keyboard, then print the sum, the product, the smallest and the largest of these numbers. Use only single selection form of if statement
write a program to use for loop print **********========== in c language
write a program to use for loop print **********========== in c language  write a program to use for loop print **========== in c language
c program
c program  plz send me program for this. write a program to print the following code? (in c language) 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 11 2 3 4 5 6 7 8 9 10
about c and java
about c and java   i need java and c language interview and objective questions with answers for the fresher.please provide to me   Please...://www.roseindia.net/c-tutorials/ http://www.roseindia.net/interviewquestions
C Language
C Language  What's the right declaration for main()? Is void main() correct? in C language ? please help me sir ! Thank You
Write a C language program to read two matrices and multiply them?
Write a C language program to read two matrices and multiply them?  Write a C language program to read two matrices and multiply them?   Here is an example of multiplying two matrices using C language. #include <
C language
C language  i want that when i hit any key only * to be print not the hit key in c language   The given example will display aestricks on hitting any key. #include "stdio.h" #include "conio.h" #include "ctype.h" int
C Language
C Language  Respected sir, Why does sizeof report a larger size than I expect for a structure type, as if there were padding at the end? help me sir
C Language
C Language  Respected Sir, How can I determine the byte offset of a field within a structure? How can I access structure fields by name at run time? please help me sir . Thank you sir
Objective-C keywords
Objective-C keywords       Here in this section we will know about the keywords used in objective-C language. Objective-C is a superset of C language, so program written in c
C++Tutorials
++ is a programming language substantially different from C. Many see C++ as "a better C than... to teach C++ in a way that makes use of what the language can offer. C++ shares... to speed on that language.      C++ Annotations
Why Objective C?
; In this section we will learn about the importance of Objective C and "Why Objective C?" is used as programming language to develop applications... organized language ?Objective-C language is selected for the Cocoa framework
Main function parameter in C language - Ajax
Main function parameter in C language  Please let me know how... as the starting point for program execution. It usually controls program execution by directing the calls to other functions in the program. A program usually
C and C++ books-page11
; The Optimize C++ Imagine that you are about to finish a relatively... with this language. This reliance on C provides important benefits: * Reuse of legacy C... C and C++ books-page11      
Objective C
you the basic introduction about Objective C programming language. Objective... In this section we will know about the keywords used in objective-C language. Objective-C is a superset of C language, so program written in c and C++ should compile
c language code
c language code  Dear Sir, Could you send me the c language codings for BOOK BANK
About JSP Expression Language - JSP-Servlet
About JSP Expression Language   Hi i am new to JSP i am now going through the basics of JSP..on the process i tried a simple JSp program... pls help... Scriptlets <% %>.Your program of Addition of two values in JSP would be as fellow
c-language pointer functions
c-language pointer functions  what is the execution process of character pointer functions with example
C/C++ Programming Books
in the dictionary.Variables are the "words" for the C language. In a program, variables have... know much about C or C++, it just introduces a new object oriented language...; Object-Oriented Programming and The Objective C Language
logic for c language
logic for c language  01 02 03 04 05 06 20 21 22 23 24 07 19 32 33 34 25 08 18 31 36 35 26 09 17 30 29 28 27 10 16 15 14 13 12 11
Change case in C language
Change case in C language  I want to right in .dat file through structure.For this i have defined following: struct student //structure defination... If user is typing b5678 ,i want to store as B5678. (C)for input i am using
C Language - Java Beginners
C Language  1. What are extension files? Give examples. 2. What is operating system? What are the different types available? 3. What is the purpose of operating system? 4. What is the function of operating system? 5
Ask C/C++ Questions online
language, but both the languages are popular among programmers. C is a general purpose programming language that can run on most of the platforms. C is used... Bell Laboratory while C++ is a popular object oriented programming language
hotel management programme in c language?
hotel management programme in c language?  hotel management programme in c language
C and C++ books-page10
; The programming language C As a programming language, C is rather... offers an introduction to the C++ programming language. It is a guide for C/C... should realize that extensive knowledge of the C programming language is actually
program of c
program of c  write a program in c to display a to z without using printf or scanf statements or header files
program
program  i want help to making a project in check current date using c language
program
program  i want help to making a project in check current date using c language
coding C
coding C  Write a program for a GENERAL NUMBER CONVERTERS which include binary, decimal, octa and hexadecimal. You need to write the program using C language
c++ program
c++ program  Write a program which reads a text from the keyboard and displays the following information on the screen in two columns: (a) Number of lines (b) Number of words (c) Number of characters Strings should be left
C Program
C Program  Why doesn't the code int a = 1000, b = 1000; long int c = a * b; work? plz help me sir
c program
c program  How to convert binary digits to decimal number without using power function
C#
C#  i need a code that will make program perform the basic operations upon the data Listview save, update and cancel
Java vs. C
++, you already know a lot of Java. The Java language is based mostly on C and C++. You'll see that a lot of the basic language elements, for example... Because of the lack of complete type definitions, moving a C/C++ program from one
c++
c++  write a program that gets a key or character from the keyboard and displays it ASII code in decimal, hexadecimal and binary form.It must also give a description of the key pressed
c++
c++  .write a program that accepts 5 subjects of a student,it should have a function to calculate the average & another function to grade.grade should be as follows-<40=E,40-49=D,50-59=C,60-69=B & >70
About PHP
with Hyper Text Mark Up Language (HTML) and several syntaxes of C, Java and Perl... PHP is a widely used powerful scripting language basically used for creating.... PHP is an open source language under PHP license and can be downloaded
C program
C program  hi, here is my question: Create a structure to specify data on students given below: Roll number, Name,Department, Course, Year... a function to print names of all students who joined in a particular year. (c
Objective C Introduction
;  This section provides you the basic introduction about Objective C programming language. Objective C is very old programming language... in early 1980's. The Objective-C language is designed to enable a easier
c program
c program  plz send me program for this. write a program to print the following code? 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 11 2 3 4 5 6 7 8 9 10 11 12 3 4
program in c
program in c  Write a program that inputs five different integers from the keyboard, then print the sum, the product, the smallest and the largest of these numbers. Use only single selection form of if statement. For example: 1 3
java & c
java & c  why c language is called top down approach? why java is called bottom to top approach?   In C, compilation stats from the very top of the program code. In Java, on the other hand, we have user defined data
c++
c++  Write the definition of the class dayType that implements the day of the week in a program. The class dayType should store the day, such as Sunday for Sunday. The program should be able to perform the following operations
C and C++ books-page1
is no longer in print, it's content is still very relevant today. The C language... This book is designed to help you teach yourself how to program with C... of the programming language C++ to any person that wants it. C++ is a third generation
c++
c++  Write a console based C++ program that reads student information from a text file, build an array of objects of type class StudentInfo... name with the minimum GPA 7) Display Student GPAs as Letter Grades (A, B, C, D
Java: Language Complexity
language complexity with user program complexity. From the student programmer's... companies want to program in a proprietary language from one supplier. Python... Java: Language Complexity Many programming language features are designed
HQL, Hibernate Query Language
HQL - Hibernate Query Language In this tutorial on HQL we will learn how...? The HQL stands for Hibernate Query Language, which is inspired by the SQL... and it properties. The Hibernate Query Language is very powerful tool
C Program to Print Stras - Development process
C Program to Print Stras  How I can Print Following Output using Two For loops in C Language? * * * * * * * * * * * * * * * *  Hi Friend, Try the following: #include #include void main(){ int i=0
C++ programming language - Java Beginners
C++ programming language  int main() { int i = 1, c = 0, sum = 1,j ; scanf("%d", &j); while (i <= j) { sum = sum + (i /3+i/5); printf
c programming language - Java Beginners
c programming language  int main() { int i = 1, c = 0, sum = 1,j ; scanf("%d", &j); while (i <= j) { sum = sum + (i /3+i/5); printf("%d

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.