05-15-2015, 03:06 AM
find the solution for the semester spring 2015 virtual university assignment 2015 for cs201 introduction to programming. by using Dev C++
In this assignment, you are required a write a simple C++ program which will input two numbers and display sum on output screen. First number shall be your ID first two digits and second number shall be the next two digits of your ID. Sample output is given below. You shall use your own VU-ID where dummy ID is used in screen shot.
![[Image: attachment.php?attachmentid=24784&stc=1]](http://www.vuhelp.net/attachment.php?attachmentid=24784&stc=1)
Solution for cs201 spring may 2015 semester
In this assignment, you are required a write a simple C++ program which will input two numbers and display sum on output screen. First number shall be your ID first two digits and second number shall be the next two digits of your ID. Sample output is given below. You shall use your own VU-ID where dummy ID is used in screen shot.
Solution for cs201 spring may 2015 semester
Code:
#include<stdio.h>
int main(){
int num,count=0;
printf("Enter a number: ");
scanf("%d",&num);
while(num){
num=num/10;
count++;
}
printf("Total digits is: %d",count);
return 0;
}