#include
#include
void main()
{
printf("%s\n","Hello How are you? ");
printf("%s\n","Welcome to c programming language. ");
printf("%s\n","Write good programs in c");
getch();
}
Program 2 :
#include
#include
void main()
{
printf("%s\n\n\n\n\n","Swathi");
printf("%s\n\n\n\n","Murali");
getch();
// these are single line comment lines
/*
these are multiple line comment lines.
here you can write any matter.
any number of lines can be written like this.
*/
}
Program 3 :
#include
#include
void main()
{
// Comment : \n means next line
// \t means 8 characters(tab)
printf("%s\t%s\n","Swathi","Murali");
printf("%s\t%s\n\n","Sreedhar","KrishnaVeni");
printf("%s\t\t\t\t%s\t%s\n","Sreevathsa","Koundinya","Jitamanyu");
getch();
}
Program 4 :
#include
#include
void main()
{
printf("%s\n","Swathi");
printf("%s\n","");
printf("%s\n","");
printf("%s\n","");
printf("%s\n","");
printf("%s\n","");
printf("%s\n","");
printf("%s\n","");
printf("%s\n","");
printf("%s\n","");
printf("%s\n","");
printf("%s\n","");
printf("%s\n","");
printf("%s\n","");
printf("%s\n","");
printf("%s\n","Murali");
printf("%s\n","Press any key to continue ...");
getch();
}
Program 5 :
#include
#include
void main()
{
// Program 4 and 5 give same output.
printf("%s\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","Swathi");
printf("%s\n","Murali");
printf("%s\n","Press any key to continue ...");
getch();
}
Program 6 :
#include
#include
void main()
{
printf("%s\n","Swathi,...........................");
printf("%s\n"," ");
printf("%s\n"," ");
printf("%s\n"," ");
printf("%s\n"," I LOVE YOU ");
printf("%s\n"," ");
printf("%s\n"," ");
printf("%s\n"," ");
printf("%s\n"," ");
printf("%s\n"," Murali");
printf("%s\n","Press any key to continue ...");
getch();
}
Program 7 :
#include
#include
void main()
{
int a;
int b = 12;
int EmpNo = 152;
int empno = 256; // int type variable accepts value from zero(0) to 32767.
// negative value are not accepted.
printf("%s\n","the following values are assigned to variables.");
printf("%d",a);
printf("%d",b);
printf("%d",EmpNo);
printf("%d",empno);
printf("%s\n","any key is ok for me, Press");
getch();
}
Program 8 :
#include
#include
void main()
{
int a; int b = 12; int EmpNo = 152; int empno = 256;
printf("%s\n","the following values are assigned to variables.");
printf("%d",a); printf("%d",b); printf("%d",EmpNo); printf("%d",empno);
printf("%s\n","any key is ok for me, Press");
getch();
}
Program 9 :
#include
#include
void main()
{
int a;
int b = 12;
int EmpNo = 152;
int empno = 256;
Empno = 255;
b = 20;
printf("%s\n","the following values are assigned to variables.");
printf("%d\n",a); printf("\n\n\n\n%d\n",b); printf("\n\n\n%d",EmpNo);
printf("\t\n\t%d",empno);
printf("%s\n","any key is ok for me, Press");
getch();
}
Program 10 :
#include
#include
void main()
{
int EmpNo = 152;
int Salary = 25000;
printf("%s\n","---------------------------------------");
printf("%s\n"," Value Labs, Hyderabad");
printf("%s\n"," a CMMi Level 4 software company");
printf("%s\n","---------------------------------------");
printf("%s","Employee Number : "); printf("%d\n",EmpNo);
printf("%s","Salary : ");
printf("%d\n",Salary);
printf("%s\n","---------------------------------------");
printf("%s\n","any key is ok for me, Press");
getch();
}
No comments:
Post a Comment