C/C++: Affichage des nombres à virgule et sans virgule

Author:


Download

#include 
int main()
{
    int data[10];
    double twice[10];

    int index;

    for (index = 0; index < 10; ++index)
	{
        data[index] = index;
        twice[index] =index;
    }
	for(int i=0;i<10;i++)
		printf("int= %d  | double= %.2f",(*data+i),twice[i]);
    return (0);
}

Leave a Reply

Your email address will not be published. Required fields are marked *