
See Our team
Wondering how we keep quality?
Got unsolved questions? Ask Questions
GATE
GMAT
CBSE
NCERT
Career
Interview
Railway
UPSC
NID
NIFT-UG
NIFT-PG
PHP
AJAX
JavaScript
Node Js
Shell Script
Research
GE2115-Computer practice Laboratory Part-1
How to study this subject
Program to print text
# include
# include
main()
{
clrscr();
printf(“HELLO WELCOME TO VIDYARTHI COMPUTERS”);
printf(“Hanamkonda Warangal phone : 0870-2574900, 9849103344”);
getch();
}
2. Program To Read Two Numbers And Print The Sum Of Given Two Numbers.
# include
# include
main()
{
int a,b, sum;
clrscr ();
printf (“ENTER VALUE FOR A ; “);
scanf (“%d”,&a);
printf(“ENTER VALUE FOR B ;”);
scanf(“%d”,&b);
sum=a+b;
printf(“Sum Of Given Two Numbers are %d”, sum);
getch();
}
3. Program To Accept Student Roll No, Marks in 3 Subjects and Calculate Total, Average and Print it.
# include
# include
main()
{ int r,b,c,d, tot, avg;
clrscr();
printf (“ENTER STUDENT RNO ; “);
scanf (“%d”,&r);
printf(“ENTER FIRST SUBJECT MARKS ;”);
scanf(“%d”,&b);
printf(“ENTER SECOND SUBJECT MARKS;”);
scanf(“%d”,&c);
printf(“ENTER THIRD SUBJECT MARKS ;”);
scanf(“%d”,&d);
tot=b+c+d;
avg=tot/3;
printf(“\n\n\t\t VIDYARTHI COMPUTERS – HANAMAKONDA \n\n”);
printf(“\t STUDENT RNO ; %d “,r);
printf(“\t FIRST SUBJECT MARKS ;%d “,b);
printf(“\t SECOND SUBJECT MARKS ;%d “,C);
printf(“\t THIRD SUBJECT MARKS ;%d “,d);
printf(“\t AVERAGE MARKS ; %d”, avg);
getch();
}
4. Program To Read Three Numbers And Print The Biggest Of Given Three Numbers
# include
# include
main( )
{
int a,b,c,big=0;
clrscr( );
printf(“ENTER VALUE FOR A:”);
scanf(“%d”,&a);
printf(“ENTER VALUE FOR B:”);
scanf(“%d”,&b);
print(“ENTER VALUE FOR C:”);
scanf(“%d”,&c);
if (a>big)
big=a ;
if(b>big)
big=b;
if (c>big)
big=c;
printf (“BIGGEST OF ABOVE GIVEN THREE NUMBER IS %d”,big)
getch( );
}
5. Program To Read A Number And Find Whether The Given Number Is Even Or Odd.
# include
# include
main()
{
int n,r;
clrscr();
printf(“ENTER A NUMBER ;”);
scanf(“%d”, &n);
r=n%2;
if(r= = 0)
printf(“the above given number is even number”);
else
printf(“the above given number is odd number”);
getch();
}
6. Program to accept a year and check whether the given year IS leap year or not.
# include
# include
main( )
{
int y;
clrscr( );
printf(“enter a year:”);
scanf(“%d”,&y);
if(y%4==0& &y%100!=0|| y%400==0);
printf(“the above given year IS a leap year”);
elseVasantha Kumar .V Lecturer CSE 3
printf(“the above given year IS not a leap year”);
getch();
}
7. Individual Digits
# include
# include
main( )
{
int a,b,c,d;
clrscr( );
printf ( “ Enter a two digit number :”);
scanf (“ %d”, &a);
b=a/10;
c=a%10;
d=b+c;
printf (“sum of individual digits of given numbers id %”, d);
getch( );
}
8. Program to accept a three digit number and print the sum of individual digits.
# include
# include
main( )
{
int a,b,c,n, sum;
clrscr( );
printf (“ Enter a Three Digit Number:“);
scanf (“%d”,&n);
a=n/100;
b=( (n%100)/10);
c=n%10;
sum=a+b+c;
printf (“ Sum of Individual Digits of Given Numbers is %d”, Sum);
getch( );
}
9. Program to accept a number and check the given number is Armstrong or not.
# include
# include
main( )
{
int n, a, b, c, d;
clrscr( );
printf (“ Enter a Three Digit Number: “);
scanf (“%d”, &n);
a=n/100;
b=((n/10)%10);
c=n%10;
d=a*a*a*+b*b*b +c*c*c;
if (n= =d)
printf (“The Given Number is Armstrong number”);
elseVasantha Kumar .V Lecturer CSE 4
printf (“The Given Number is Not Armstrong number”);
getch( );
}
10. Program to print ODD numbers from 1 to 10
# include
# include
main( )
{
int i;
clrscr( );
for (i=1; i<=10; i+=2)
printf(“%d\n”,i);
getch( );
}
Add contents here
Official Notes
Add contents here
Notes from other sources
Add contents here
Model question papers
Add contents here
Previous year question papers
Add contents here
Useful links
Add contents here