fork download
  1. #include<stdio.h>
  2.  
  3. int main(){
  4. int choice, a = 10 , b= 20;
  5. printf("Enter 1 to add two numbers\n");
  6. scanf("%",&choice);
  7.  
  8. if (choice == 1)
  9. {
  10. printf("Addition of two numbers = %d \n", a+b);
  11. }
  12. else{
  13. printf("Invalid choice \n");
  14. }
  15. return 0;
  16.  
  17. }
Success #stdin #stdout 0s 5320KB
stdin
 
stdout
Enter 1 to add two numbers
Invalid choice