STUDENTS 3K

  • Home
  • Students+
    • Engineering Students
    • Education Loan
    • Study Abroad Guide
    • Projects Download
  • Freshers
    • Aptitude Q & A
    • Placement Papers
    • Verbal Ability
    • Interview Questions
    • IT Company Details
    • Job Updates
  • Study Resources
    • Career Guidance
    • LAB Programs
      • C Programs
      • CPP Programs [C++]
      • Java Programs
    • Question Papers
    • Learn English
    • Notice Board
  • More –>>
    • Love calculator
You are here: Home / Important Programs / Sum of n numbers till encounters -999 using C program

Sum of n numbers till encounters -999 using C program

Sum of n numbers till encounters -999 using C program will check the number is equal to -999. If it is same, then it will break the statement. Otherwise it will sum the given numbers and executes the condition until the condition is unsatisfied.

  • Sum of N numbers using Array in C
  • How to get month name from month number – C program

[Read: Career Guidance for all] & [Aptitude Q&A free download]

C PROGRAM:

//Header files
# include <stdio.h>
# include <conio.h>

void main()
{
	//Program variables
	int num,sum=0;

	clrscr();//Function used to clear previous output

	do //Unconditional statement
	{
	printf("Enter the number(-999 to exit) : "); //Display function
		scanf("%d",&num); //Getting input function
		if(num!= -999)
			sum += num;
		else
			break;
	}while(num != -999);
	printf("sum = %d",sum);
	getch();
}

Filed Under: Important Programs Tagged With: C, LAB, Programs





Random Materials :

  • Data Mining and Data Warehousing
  • Difference Between Class and Primitive Types
  • Database Roles in SQL
  • CASE Expression in SQL
  • Concurrent Update Problem

Follow Us on Facebook

Advertisement

Company Profile

  • About Students3k
  • Contact Us
  • Earn Money Online
  • Website Archive Page
  • Privacy Policy
  • Disclaimer

Categories

  • Important Programs
  • Study Abroad
  • IT Companies
  • Career Guidance for Students
  • Teachers
  • Verbal Analogies

We Are Social

  • Facebook Fans
  • Twitter Follow
  • Google Plus
  • Pinterest Page

© Copyright 2012 - 2016 Students3k.com · All Rights Reserved · Designed By Benefits

Show