Home

Learn Programming & Prepare for NPTEL Exams... Swayam Solver is your one-stop destination for NPTEL exam preparation.

Problem Solving Through Programming In C | Week-03: Programs | Jan-2022 | NPTEL

 Problem Solving Through Programming In C


				Due on 2022-02-17, 23:59 IST

----------------------------------------------------------
Week-03: Program-01
----------------------------------------------------------



    area = PI * radius * radius;
  


---------------------------------------------------------
Week-03: Program-02
---------------------------------------------------------

	if(number==0)
          printf("The number is 0.");
	else if(number<0)
          printf("Negative number.");
    	else if(number>0)
          printf("Positive number.");
  
  return 0;
}


---------------------------------------------------------
Week-03: Program-03
---------------------------------------------------------

     if(number%2==0)
   printf("%d is even.", number);
 else
   printf("%d is odd.", number);
 
return 0;

}

----------------------------------------------------------
Week-03: Program-04
----------------------------------------------------------

if((n1>=n2)&&(n1>=n3))
  printf("%d is the largest number.", n1);
if((n2>=n1)&&(n2>=n3))
  printf("%d is the largest number.", n2);
if((n3>=n1)&&(n3>=n2))
  printf("%d is the largest number.", n3);
return 0;
}


----------------------------------------------------------

No comments:

Post a Comment

Keep your comments reader friendly. Be civil and respectful. No self-promotion or spam. Stick to the topic. Questions welcome.