Code:#include "stdafx.h" int _tmain(int argc, _TCHAR* argv[]) {//variable names int Int1, Int2, Int3, sum, average, product; //takes user input printf("input three different integers: "); scanf("%d%d%d", &Int1,&Int2,&Int3); //equation process sum = Int1 + Int2 + Int3; average = sum / 3; product = Int1 * Int2 * Int3; cout<<"Enter Int1 : "; cin>>Int1; cout<<"Enter Int2 : "; cin>>Int2; cout<<"Enter Int3 : "; cin>>Int3; if(Int1>=Int2) { if(Int1>=Int3) { cout<<"Largest Number Is : "<<Int1; if(Int2<=Int3) cout<<"Smallest Number Is : "<<Int2; else cout<<"Smallest Number Is : "<<Int3; } else { cout<<"Largest Number Is : "<<Int3; cout<<"Smallest Number Is : "<<Int2; } } else { if(Int2>=Int3) { cout<<"Largest Number Is : "<<Int2; if(Int1<=Int3) cout<<"Smallest Number Is : "<<Int1; else cout<<"Smallest Number Is : "<<Int3; } else { cout<<"Largest Number Is : "<<Int3; cout<<"Smallest Number Is : "<<Int1; } } //prints results printf("Sum is %d\nAverage is %d\nProduct is %d\n", sum, average, product); return 0; }
im trying to make it so it tells me the smallest and largest of the 3 integers but i keep getting the following error:
error C2065: 'cout' : undeclared identifier
error C2065: 'cin' : undeclared identifier
what do i do




Reply With Quote