1) Sample C Program To Print A Message.
# include <stdio.h>
# include <conio.h>
main()
{
clrscr();
printf("HELLO WELCOME TO WWW.INTERVIEW-MADE-EASY.COM");
printf("Answers To All Important Interview Questions");
getch();
}
2) Sample C Program To Read Two Numbers And Print The Sum Of Given Two Numbers.
# include <stdio.h>
# include <conio.h>
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) Sample C Program To Accept Student Roll No, Marks in 3 Subjects and Calculate Total, Average and Print it.
# include <stdio.h>
# include <conio.h>
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 XYZ College \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();
}
ALSO CHECK THESE C PROGRAMS:
- C Program To Calculate Simple Interest.
- C Program To Find Factorial Of A Number.
- C Program To Find The Reverse Of A Number.
- C program To Print First Ten Numbers.
- C Program To Add Two Numbers & Perform Arithmetic Operations.
- C Program To Print Sum Of Digits In A Number.
- C Program To Swap Two Numbers Using Temporary Variables.
...Back To C Program Index.
Comments
Post a Comment
Please share your opinions and suggestions or your experience in the comments section. This way we can all help each other...
Experienced guys can share their resumes at admin@interview-made-easy.com