0% found this document useful (0 votes)
53 views3 pages

Noc20-Cs06 Week 04 Assignment 05

This document is from an online NPTEL course on problem solving through programming in C. It provides instructions for assignment 4, week 4 of the course, which asks students to write a C program to calculate power of a number using while loops, taking the base and exponent as input from test cases. Sample test cases and a sample solution are provided. The due date for this assignment has passed and this student has not submitted it.

Uploaded by

sdf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views3 pages

Noc20-Cs06 Week 04 Assignment 05

This document is from an online NPTEL course on problem solving through programming in C. It provides instructions for assignment 4, week 4 of the course, which asks students to write a C program to calculate power of a number using while loops, taking the base and exponent as input from test cases. Sample test cases and a sample solution are provided. The due date for this assignment has passed and this student has not submitted it.

Uploaded by

sdf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

03/07/2020 Problem solving through Programming In C - Course

(https://swayam.gov.in) (https://swayam.gov.in/nc_details/NPTEL)

reviewer4@nptel.iitm.ac.in 

NPTEL (https://swayam.gov.in/explorer?ncCode=NPTEL) » Problem solving through Programming In C

(course)

Announcements (announcements)

About the Course (https://swayam.gov.in/nd1_noc20_cs06/preview) Ask a Question (forum)

Progress (student/home) Mentor (student/mentor)

Week-04 Program-04
Course Due on 2020-02-27, 23:59 IST
outline
Write a C program to find power of a number using while loops. The
base number (>0) and exponent (>=0) is taken from the test cases.
How does an
NPTEL online
course work?
Sample Test Cases
Week 0 Input Output

6
Week 1 Test Case 1 The result is : 1
0

Week 2
4
Test Case 2 The result is : 65536
8
Week 3

5
Week 4 Test Case 3 The result is : 625
4
Lecture 16: IF-
ELSE 7
Statement Test Case 4 The result is : 343
3
(Contd.) (unit?
unit=5&lesson=30)
The due date for submitting this assignment has passed.
Lecture 17:
Switch
As per our records you have not submitted this assignment.
statement Sample solutions (Provided by instructor)
(unit? 1 #include <stdio.h>
unit=5&lesson=31) 2 int main()
3 {
4 int base, exponent;
Lecture 18: 5 long int result;
Switch 6 scanf("%d", &base); //The base value is taken from test case

https://onlinecourses.nptel.ac.in/noc20_cs06/progassignment?name=112 1/3
03/07/2020 Problem solving through Programming In C - Course

Statement 7 scanf("%d", &exponent); //The exponent value is taken from test case
(Contd.) and 8
9 if(exponent == 0)
Introduction to 10 result = 1;
Loops (unit? 11 else
unit=5&lesson=32) 12 {
13 result = 1;
14 while(exponent != 0)
Lecture 19: 15 {
Implementing 16 result = result * base;
Repetitions 17 --exponent;
18 }
(Loops) (unit? 19 }
unit=5&lesson=33) 20 printf("The result is : %ld\n", result);
21 return 0;
Lecture 20: 22 }
23
Implementation
of Loops with
for Statement
(Contd.) (unit?
unit=5&lesson=34)

Quiz :
Assignment 4
(assessment?
name=103)

Week-04
Program-01
(/noc20_cs06/progassignment?
name=109)

Week-04
Program-02
(/noc20_cs06/progassignment?
name=110)

Week-04
Program-03
(/noc20_cs06/progassignment?
name=111)

Week-04
Program-04
(/noc20_cs06/progassignment?
name=112)

Week-04
Program-05
(/noc20_cs06/progassignment?
name=113)

Feedback For
Week 4 (unit?
unit=5&lesson=115)

Week 5

Week 6

Week 7

Week 8

Week 9

https://onlinecourses.nptel.ac.in/noc20_cs06/progassignment?name=112 2/3
03/07/2020 Problem solving through Programming In C - Course

Week 10

Week 11

Week 12

DOWNLOAD
VIDEOS

Assignment
Solution

https://onlinecourses.nptel.ac.in/noc20_cs06/progassignment?name=112 3/3

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy