Search
 
SCRIPT & CODE EXAMPLE
 

C

ask the user if they would like to do something again in C

#include<stdio.h>
int main(){
int x, y, sum;
char ch;
print:
    printf ("Enter the first number:");
    scanf ("%d",&x);
    printf ("Enter the second number:");
    scanf ("%d",&y);
    sum=x+y;
    printf ("
The total number is:%d
",sum);
again:
    printf ("
					Do you want to repeat the operation(Y/N): ");
    scanf (" %c", &ch);

    if(ch == 'y' || ch == 'Y'){
        goto print;
    }
    else if(ch == 'n' || ch == 'N'){
        return 0;
    }
    else{
        printf("
					Please enter Yes or NO.
");
        goto again;
    }
   return 0;
Comment

PREVIOUS NEXT
Code Example
C :: rand in c 
C :: can torch light bring change in chemical reaction 
C :: how to link flexslider 
C :: c create array 
C :: C static libraries (creating object files) 
C :: c ausgabe 
C :: call cuda kernel from c parameters 
C :: minimun number of moves in c 
C :: int main() { int sum =0; FILE * ptr; ptr = fopen("d:students. "," "); if (ptr ==NULL){ ("file does not exist!!"); exit(0); } 
C :: georgia institute of technology 
C :: My name is c 
C :: c limit value range 
C :: which one is faster loop or recursive function? 
C :: Convert arduino String to C language String 
C :: bullseye lxc network problem 
C :: command line coursera 
C :: panagram in c 
C :: profile time bash script 
C :: FivemStore 
C :: snake spielen 
C :: programmation c 
C :: Typecast Operator in C language 
C :: website how to solve c programming questions 
Dart :: flutter listtile shape 
Dart :: flutetr stepper color 
Dart :: how to get whatsapp groups in app flutter programmatically 
Dart :: flutter appbar icon 
Dart :: flutter launcher icon generate 
Dart :: remove menu icon from appbar flutter 
Dart :: flutter listtile color 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =