Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  Lab9
Language: C/C++
Code:
#include<stdio.h>
#include<conio.h>
int main() {
    int val1, val2, val3;
    printf("Enter a value: ");
    scanf("%d", &val1);
    printf("Enter a multiplier: ");
    scanf("%d", &val2);

    if (val2 == 1) 
    {
        val3 = val1 * 3;
    }
    else
    {
         val3 = val1 * val2;
    }
    printf("%.2d becomes %.2d", val1, val3);
getch();
return 0;
}
          
Comments: