loops questions on c
#include <stdio.h>
int main( )
{
int x = 10, y = 3, z;
for(z = 0; z<x; )
z = z++ +y;
printf("%d\n", z) ;
return 0;
}
loops questions on c
#include <stdio.h>
int main( )
{
int x = 10, y = 3, z;
for(z = 0; z<x; )
z = z++ +y;
printf("%d\n", z) ;
return 0;
}
sample c programs for interview
/*C program to convert number from decimal to binary*/
#include <stdio.h>
int main()
{
int number,cnt,i;
int bin[32];
printf("Enter decimal number: ");
scanf("%d",&number);
cnt=0; /*initialize index to zero*/
while(number>0)
{
bin[cnt]=number%2;
number=number/2;
cnt++;
}
/*print value in reverse order*/
printf("Binary value is: ");
for(i=(cnt-1); i>=0;i--)
printf("%d",bin[i]);
return 0;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us