#include <stdio.
h>
int main()
{
int n,a,b;
a=10;
b=20;
n=a>b?printf("a"):printf("b")
return 0;
}
#include <stdio.h>
int main()
{
int n,a,b;
printf("enter the one value");
scaf("%d",& a);
printf("enter the other value");
scaf("%d",& b);
n=a>b?printf("a"):printf("b");
return 0;
}
#include<stdio.h>
main()
{
int mins,hours,minutes,secs;
printf("Enter the time in minutes: ");
scanf("%d",&minutes);
hours=minutes/60;
mins=minutes%60;
printf("Hours in mins and seconds: %d hours %d mins\n",
hours, mins);
return 0;
}
PASSED AVG>=50
FAIL AVG<50
DECLARE VARIABLES
MATHS = 40
ENGLISH = 59
GEOGRAPHY =60
STEPS
IF AVG>=50
PASSED
IF AVG<50
FAILED
#include <stdio.h>
main()
{
int main maths, eng, geo, sum, ave;
math=40;
eng=59;
geo=60;
sum=maths+eng+geo;
ave=sum/3;
IF (ave>=50);
printf("PASSED");
IF (ave<50);
printf("FAILED")
#include<stdio.h>
main()
{
int mk1,mk2,mk3,total,avg;
printf("Enter marks for English: ");
scanf("%d",&mk1);
printf("Enter marks for Mathematics: ");
scanf("%d",&mk2);
printf("Enter marks for Geography: ");
scanf("%d",&mk3);
total=mk1+mk2+mk3;
avg=total/3;
printf("English Score: %d\n",mk1);
printf("Mathematics Score: %d\n",mk2);
printf("Geography Score: %d\n",mk3);
printf("The total marks: %d\n",total);
printf("The average marks: %d\n",avg);
if(avg>=50)
{
printf("You Passed well!!! Congratulations\n");
}
else
{
printf("You Failed terribly!!!! Need to rewind");
}
return 0:
}