Posts

Showing posts with the label Input through Keyboard

C Program Check even and odd input

Image
C Program  Check even and odd input #include<conio.h> #include<stdio.h> void main() {     int num1;     clrscr();     printf("Enter number : ");     scanf("%d",&num1);     if(num1%2==0)     printf("%d is Even number ",num1);     else     printf("%d is odd number ",num1);     getch(); } Output:

Add two integer numbers with user input

Program to add two integer numbers and give number at run-time #include<conio.h> #include<stdio.h> void main() { int number1, number 2; clrscr(); printf("Enter First Integer number : "); scanf("%d", &number1); printf("Enter Second Integer number : "); scanf("%d", &number2); printf( " Sum of %d and %d is %d" ,number1,number2,number1+number1); getch(); }

User Input

Program to give in put through keyboard or Program to give input at run time #include<conio.h> #include<stdio.h> void main() { char name; clrscr(); printf("enter your name : "); scanf("%s ",& name); getch(); } OutPut enter your name : BRIJESH