BCA

C LAB :PART A

PROGRAM 1 PROGRAM 2 PROGRAM 3 PROGRAM 4 PROGRAM 5 PROGRAM 6 PROGRAM 7 PROGRAM 8 PROGRAM 9 PROGRAM 10

C LAB : PART B

PROGRAM 1 PROGRAM 2 PROGRAM 3 PROGRAM 4 PROGRAM 5 PROGRAM 6 PROGRAM 7 PROGRAM 8 PROGRAM 9 PROGRAM 10

Write a C Program to read numbers from keyboard continuously till the user presses 999 and to find the sum of only positive numb

 



/*
Write a C Program to read numbers from keyboard continuously till the user presses 999 and
to find the sum of only positive number
*/

#include < stdio.h>

 
void main()
{
    int num1=0, sum=0;


    while (num1!=999){


        if(num1>0)
            sum=sum+num1;

        printf("\nEnter the values (999 to exit) :");
        scanf("%d",&num1);
   

    }

printf("\n SUM of all number :%d  \n",sum );

}