Total of first 10 Numbers



            main()  
            {    
                int n = 1, total = 0;  
                clrscr();  
            
                while (n <= 10)  
                {  
                    printf("\n %d", n);  
                    total = total + n;  
                    n = n + 1;  
                }  
            
                printf("\n Total: %d", total);  
            
                getch();  
            }  
            
            

Output: