Advertisement
hackercademy

SimpleCProgramm

Nov 21st, 2013
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. main()
  4. {
  5.    int a, b, c;
  6.    char ch;
  7.  
  8.    while(1)
  9.    {
  10.       printf("Enter values of a and b\n");
  11.       scanf("%d%d",&a,&b);
  12.  
  13.       c = a + b;
  14.  
  15.       printf("a + b = %d\n", c);
  16.  
  17.       printf("Do you wish to add more numbers(y/n)\n");
  18.       scanf(" %c",&ch);
  19.  
  20.       if ( ch == 'y' || ch == 'Y' )
  21.          continue;
  22.       else
  23.      break;
  24.    }
  25.  
  26.    return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement