[ create a new paste ] login | about

Link: http://codepad.org/3CanaaUJ    [ raw code | output | fork ]

C, pasted on Mar 17:
#include<stdio.h>
int main()
{
 int a, b, i=0;
 a=20;
b=5;

 printf("Enter the value to be divided: \n");
 scanf("%d", &a);

 printf("Enter the value to be used to divide a: \n");
 scanf("%d", &b);

  while(b>a)
  {
      i=i+1;
      a=a-b;
  }
  printf("%d", &i);

return 0;
}


Output:
1
2
3
Enter the value to be divided: 
Enter the value to be used to divide a: 
-4413348


Create a new paste based on this one


Comments: