Problem 6: Variable

Take three integer variables a, b and c. Assign values to the variables- a = 10, b = 20 and c = 30; Now print the sum of these three variables.

6,041 total views, 2 views today

Comments

comments

10 thoughts on “Problem 6: Variable”

  1. #include
    int main()
    {
    int a=10,b=20,c=30;
    printf(“Sum= %d”,a+b+c);
    return (0);
    }

  2. #include
    main()
    {
    int a=10,b=20,c=30,result;
    printf(“A=10\nB=20\nC=30″);
    result=a+b+c;
    printf(” \nThe sum of these three variables :%d\n”,result);

    }

  3. #include
    int main()
    {
    int a=10,b=20,c=30,d;
    d=a+b+c;
    printf(“The sum of these variable is %d\n”,d);
    }

  4. #include
    int main (){
    int a,b,c,sum;
    a=10,b=20,c=30;
    sum=a+b+c;
    printf(“the sum is:%d”,sum);
    return 0;
    }

  5. #include
    int main()
    {
    int a,b,c,sum;

    a = 10;
    b = 20;
    c = 30;

    sum = a + b + c;

    printf(“%d”,sum);

    return 0;
    }

  6. #include
    int main()
    {
    int a=10,b=20,c=30,sum;
    sum=a+b+c;
    printf(“sum is %d”,sum);
    return 0;

    }

  7. #include
    int main()
    {
    int a=10,b=20,c=30,sum=a+b+c;
    printf(“sum=%d”sum);
    return 0;
    }

Leave a Reply

Your email address will not be published.