Mindtree
Company
Programming
Basics
you have three dice each side is numbered as 1,2,3,4,5,6 .you have to take a number from user check that number as sum of any side number of these three dice.like we take number as 5 then the possibility are (1,1,3) (1,2,2) (1,3,1) (2,1,2) (2,2,1) (3,1,1) and is 6 possibility. So write to a program for that. You can write program in c.
Read Solution (Total 8)
-
- source code in c language
#include
void main()
{
int n,i,j,k;
printf("enter a num :n ",n);
scanf("%d",&n);
for(i=1;i - 8 years agoHelpfull: Yes(34) No(26)
- #include
int main()
{
int i,j,k,a;
static int count;
printf("enter the no.n");
scanf("%d",&a);
for(i=1;i - 8 years agoHelpfull: Yes(6) No(10)
- import java.util.*;
/*write a program to print all the possible combinations so that we get the user input */
public class Dice {
public static void main(String [] args)
{
int a[]={1,2,3,4,5,6};
int b[]={1,2,3,4,5,6};
int c[]={1,2,3,4,5,6};
int user=new Scanner(System.in).nextInt();
int count=0;
for(int i=0;i - 8 years agoHelpfull: Yes(4) No(9)
- //Solution In C++
#include
using namespace std;
int main()
{
int t;
int arr[6]={1,2,3,4,5,6};
cin>>t;
for(int i=0;i - 8 years agoHelpfull: Yes(3) No(15)
- #include
int main()
{
int i, j, n,count=0,c,k;
printf("Enter N: ");
scanf("%d", &n);
for(i=1; i - 7 years agoHelpfull: Yes(2) No(4)
- #include
int main()
{
int N,dice1,dice2,dice3,count=0;
scanf("%d",&N);
if(N>=3)
{
for(dice1=1;dice1 - 6 years agoHelpfull: Yes(2) No(2)
- import java.util.*;
class diceprob{
public static void main(String s[]){
System.out.println("enter number to check the possiblity");
Scanner sc=new Scanner(System.in);
int num=Integer.parseInt(sc.next());
int a[]={1,2,3,4,5,6};
int b[]={1,2,3,4,5,6};
int c[]={1,2,3,4,5,6};
int count=0;
if(num18){System.out.println("0");return;}
else{
for(int i=0;i - 7 years agoHelpfull: Yes(1) No(5)
- #include
int main()
{
int i, num1, num2, min, hcf=1;
printf("Enter any two numbers to find HCF: ");
scanf("%d %d", &num1, &num2);
min = (num1 - 7 years agoHelpfull: Yes(1) No(3)
Mindtree Other Question