Posts

Showing posts with the label User Input

Swapping of Two number

Image
C Program to Swapping of Two number #include<conio.h> #include<stdio.h> void main() {     int num1,num2,temp=0;     clrscr();     printf("Enter first number : ");     scanf("%d",&num1);     printf("Enter second number : ");     scanf("%d",&num2);     printf("\n\nValue of A: %d   and  Value of B: %d",num1,num2);     temp=num1;     num1=num2;     num2=temp;     printf("\n\n\n After swaping \n\n");     printf("Value of A: %d   and  Value of B: %d",num1,num2);     getch(); } out put

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