12/05/2021
Whatsapp : https://wa.me/918128166631
Easy way to learn C Language at your place. You can also share you experience and Programming knowle
12/05/2021
Whatsapp : https://wa.me/918128166631
06/11/2017
uname Admin
password 112285
void main()
{
char username[10];
int pass;
printf("Enter Username : ");
scanf("%s",username);
printf("\nEnter Password");
scanf("%d",&pass);
if(username!=uname)
printf("\nUsername is wrong");
else if (pass!=password)
printf("\nWrong Password");
else
printf("Login Successfully");
getch();
}
Updated version of 'C Solutions' coming soon...
With tutorials
And more than 100 new programming excersis...
30/12/2016
QUESTION:
----------------
Area of a triangle is given by the formula
A=sqrt(S(S-a)(S-b)(S-c))
Where a, b and c are sides of the triangle and 2S=a+b+c. Write a program to compute the area of the triangle given the values of a, b and c
CODDING:
---------------
void main()
{
int a,b,c;
float S,Area;
a=b=c=S=0;
clrscr();
a=20;
b=30;
c=40;
S=(a+b+c)/2;
Area=sqrt(S*(S-a)*(S-b)*(S-c));
printf("Area of a triangle is= %f",Area);
getch();
}
OUTPUT:
-------------
Area of a triangle is= 290.473755
download C Solutions App https://goo.gl/JVY4dT
QUESTION:
---------------
Given the values of three variables a, b and c, write a program to compute and display the values of x, where
X= a / (b -c)
Execute your program for the following values:
(a) a=250, b==85,c=25
CODDING:
---------------
void main()
{
clrscr();
int a,b,c;
float x;
a=250;
b=85;
c=25;
x=a/(b-c);
printf("x = %f\n",x);
a=300;
b=70;
c=70;
x=a/(b-c);
printf("x = %f\n",x);
getch()
OUTPUT:
-------------
x=4.000000
QUESTION:
-----------
Given two integers 20 and 10, write a program that uses a function add() to add these two numbers and sub() to find the difference of these two numbers and then display the sum and difference in the following form:
20 + 10 = 30
20-10 = 10
CODDING:
---------
void main()
{
clrscr();
int Sum,Diff;
printf("First Number 20\n");
printf("Second Number 10\n");
Sum=20+10;
Diff=20-10;
printf("20 + 10 = %d\n", Sum);
printf("20 -10 = %d", Diff);
getch();
}
OUTPUT:
--------
20 + 10 = 30
20 -10 = 10
QUESTION:
------------
Given the radius of a circle, write a program to compute and display its area.
Use a symbolic constant to define the p value and assume a suitable value for
radius.
CODDING:
----------
PIE 3.14
void main()
{
clrscr();
float Rad,Area;Rad=4;
Area=PIE*Rad*Rad;
printf("Area of a circle is--> %f",Area);
getch();
}
OUTPUT:
-----------
Area of a circle is 50.240002
Making pattern without for loop...
QUESTION:
---------
Write a program using one print statement to print the pattern of asterisks as
shown below :
*
**
***
****
CODDING:
--------
void main()
{
clrscr();
printf("* \n* * \n* * * \n* * * *");
getch();
OUTPUT:
---------
*
**
***
****
Hi Friends....
Lets Hello the world...!!
void main()
{
clrscr();
printf("Hello World....!!!");
getch();
}
Now Smile plz.....:)
Hey Friends !! Can u guess the output ???
# include
# include
void main()
{
char ch[]="I AM AN IDIOT.";
char c='A';
int i=0;
while(c)
{
c=getch();
printf("%c\a",ch[i]);
i++;
if(i==14)
{
printf(" "); i=0;
}
}
}
29/12/2014