Test 2
Test 2
Class: S.Y.B.C.A
Roll N0: 50
}
getch();
}
Output:
The Subtraction is 30
Enter the two number.
3
4
Enter your Choice:
+ Addition.
- Subtraction.
* Multiplication.
/ Division.
The Addition is 7
#include<stdio.h>
#include<conio.h>
void main()
{
long char_count=0;
clrscr();
printf("\nEnter text : Press ^z(ctrl+z) to terminate.\n");
while(getchar()!=EOF)
{
char_count=char_count+1;
}
Output:
Number of characters = 6
Name: sandeep kumar
Class: S.Y.B.C.A
Roll N0: 50
getch();
}
Output:
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf ("\nEnter the number = \n");
scanf ("%d",&a);
b=a%2;
if(b==0)
printf ("%d is Even.",a);
else
printf ("%d is Odd.",a);
getch();
}
OUTPUT:
#include<stdio.h>
#include<conio.h>
void main()
{
char inchar;
int line=0;
clrscr();
printf("\nEnter a passage of text : Press ^z(ctrl+z) to exit. \n");
while((inchar=getchar())==' '||inchar=='\t'||inchar=='\n');
while(inchar !=EOF)
{
if(inchar=='\n')
line++;
inchar=getchar();
}
line++;
printf("\nThe number of line in the given passage is : %d",line);
}
Output:
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf ("\nEnter the number = \n");
scanf ("%d",&a);
b=a%2;
if(b==0)
printf ("%d is Even.",a);
else
printf ("%d is Odd.",a);
getch();
}
OUTPUT:
Output: