Even odd total using while



            main()  
            {    
                int k = 1, e = 0, d = 0, no;  
                clrscr();  
            
                while (k <= 10)  
                {  
                    printf("\n Enter any number: ");  
                    scanf("%d", &no);  
            
                    if (no % 2 == 0)  
                    {  
                        e = e + no;  
                    }  
                    else  
                    {  
                        d = d + no;  
                    }  
                    k = k + 1;  
                }  
            
                printf("\n Even total: %d", e);  
                printf("\n Odd total: %d", d);  
            
                getch();  
            }  
            
            

Output: