WEEK: 3 PROGRAM 3 AND PROGRAM 4 NPTEL Problem Solving through Programming in C (Jan 27) 2020 solutions


PROBLEM SOLVING THROUGH PROGRAMMING IN C.

By Prof. ANUPAM BASU


WEEK 3:PROGRAM 3:

Write a C program to check whether a given number (integer) is Even or Odd. 


int p;

p=number%2;

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


WEEK 3:PROGRAM 4:


Write a C Program to find the Largest Number (integer)  among Three Numbers (integers) using IF and Logical && operator. 


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


FOLLOW OUR WEBSITE FROM THE BUTTON PROVIDED TO THE BOTTOM OF PAGE TO GET SOON ANSWERS OF PROGRAMS.

Disclaimer: Here you can find all nptel assignment solutions related to CS stream.These may help you for your assignment.The answers are only for verification.You cannot copy these directly from the post(code of conduct of NPTEL).These is not 100%  cor

No comments:

Post a Comment

If you have any problems related to solutions or any concept please let me know.

Copyright (c) 2020 Custom Programs All Right Reserved

Pages