ok im sure this is just something small im missing but im still missing it when i compile this and select an amount when the program is running it prints everything, however i only want it to print for the selected number. how can make this so it only prints the number i select? oh and the program is supposed to print the row headers of a k-map for the selected number of variables.
Thank you
thanks guysCode:#include<stdio.h> int main(void) { int a; printf("Number of Variables (1-10): \n"); scanf("%i", &a); if(a=1) { printf("\n0\n1\n"); } if(a=2) { printf("\n0\n1\n"); } if(a=3) { printf("\n00\n01\n11\n10\n"); } if(a=4) { printf("\n00\n01\n11\n10\n"); } if(a=5) { printf("\n000\n001\n011\n010\n100\n101\n111\n110\n"); } if(a=6) { printf("\n000\n001\n011\n010\n100\n101\n111\n110\n"); } if(a=7) { printf("\n000\n001\n011\n010\n100\n101\n111\n110\n"); } if(a=8) { printf("\n0000\n0001\n0011\n0010\n0110\n0111\n0101\n0100\n1100\n1000\n1001\n1011\n1010\n1110\n1111\n1101\n"); } if(a=9) { printf("\n0000\n0001\n0011\n0010\n0110\n0111\n0101\n0100\n1100\n1000\n1001\n1011\n1010\n1110\n1111\n1101\n"); } if(a=10) { printf("\n00000\n00001\n00011\n00010\n00110\n00111\n00101\n00100\n01100\n01000\n01001\n01011\n01010\n01110\n01111\n01101\n10000\n10001\n10011\n10010\n10110\n10111\n10101\n10100\n11100\n11000\n11001\n11011\n11010\n11110\n11111\n11101\n"); } return a; }