1)Splitting into Teams
code:
5)TRIANGLE SIDES
code:
7)THREE IDIOTS
code :
#include<stdio.h>
int main()
{ | |
int nos,not; | |
printf("Enter the number of students in the class\n"); | |
scanf("%d",&nos); | |
printf("Enter the number of teams\n"); | |
scanf("%d",¬); | |
printf("The number of students in each team is %d and the number of students left out is %d\n",nos/not,nos%not); | |
return 0; | |
} |
2)Alice in wonderland
code:
#include<stdio.h>
int main() | |
{ | |
int bird,ans; | |
printf("The bird said:\n"); | |
scanf("%d",&bird); | |
ans=bird%10; | |
bird=bird/10; | |
ans=ans+bird; | |
printf("Alice must go in path-%d to find her way to home\n",ans); | |
return 0; | |
} |
3)FENCING THE GROUND
code:
4)PLACING THE FLAG POST
code:
#include<stdio.h> |
int main() | |
{ | |
int l,b; | |
printf("Enter the length of the ground\n"); | |
scanf("%d",&l); | |
printf("Enter the width of the ground\n"); | |
scanf("%d",&b); | |
printf("The length of the rope needed is %dm\n",2*l+2*b); | |
printf("The quantity of carpet needed is %dsqm\n",l*b); | |
return 0; | |
} |
code:
#include<stdio.h> int main() | |
{ | |
int x,y,b; | |
printf("Enter the x-coordinate of the left bottom vertex\n"); | |
scanf("%d",&x); | |
printf("Enter the y-coordinate of the left bottom vertex\n"); | |
scanf("%d",&y); | |
printf("Enter the length of a side\n"); | |
scanf("%d",&b); | |
printf("The centre of the ground is at (%d,%d)\n",x+b/2,y+b/2); | |
return 0; | |
} |
5)TRIANGLE SIDES
code:
6)INTERCEPTS
code:
#include<stdio.h>
int main() | |
{ | |
int x,y,m,c; | |
printf("Enter the value of m\n"); | |
scanf("%d",&m); | |
printf("Enter the value of c\n"); | |
scanf("%d",&c); | |
printf("The line equation is y=%dx+%d\n",m,c); | |
x=-c/m; | |
y=c; | |
printf("The x intercept is %d\n",x); | |
printf("The y intercept is %d\n",y); | |
printf("The house number is %d\n",x+y); | |
return 0; | |
} |
No comments:
Post a Comment